Package org.docx4j.openpackaging.parts

Examples of org.docx4j.openpackaging.parts.PartName


   */
  private static SlidePart createSlidePart(MainPresentationPart pp, SlideLayoutPart layoutPart, int i)
    throws InvalidFormatException, JAXBException {
   
    // Slide part
    SlidePart slidePart = new SlidePart(new PartName("/ppt/slides/slide" + i +".xml") );
    pp.addSlideIdListEntry(slidePart);

    slidePart.setJaxbElement( SlidePart.createSld() );
   
    // Slide layout part
View Full Code Here


 
    String outputfilepath = System.getProperty("user.dir") + "/OUT_Xlsx4JAddImage.xlsx";
    String imagefilePath = System.getProperty("user.dir")+"/src/test/resources/images/greentick.png" ;
   
    SpreadsheetMLPackage pkg = SpreadsheetMLPackage.createPackage();
    WorksheetPart worksheet = pkg.createWorksheetPart(new PartName("/xl/worksheets/sheet1.xml"), "Sheet1", 1);

    // Create Drawing part and add to sheet
    Drawing drawingPart = new Drawing();
    Relationship drawingRel = worksheet.addTargetPart(drawingPart);
View Full Code Here

    }

    PresentationMLPackage pMLPackage =
      (PresentationMLPackage)OpcPackage.load(new java.io.File(inputfilepath));

    SlidePart slide = (SlidePart)pMLPackage.getParts().get(new PartName("/ppt/slides/slide1.xml") );
   
    new TraversalUtil(slide.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame(),

    new Callback() {
View Full Code Here

    // Create skeletal package, including a MainPresentationPart and a SlideLayoutPart
    PresentationMLPackage presentationMLPackage = PresentationMLPackage.createPackage();
   
    if (MACRO_ENABLE) {
      ContentTypeManager ctm = presentationMLPackage.getContentTypeManager();
      ctm.removeContentType(new PartName("/ppt/presentation.xml") );
      ctm.addOverrideContentType(new URI("/ppt/presentation.xml"), ContentTypes.PRESENTATIONML_MACROENABLED);
    }
    
    // Need references to these parts to create a slide
    // Please note that these parts *already exist* - they are
    // created by createPackage() above.  See that method
    // for instruction on how to create and add a part.
    MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get(
        new PartName("/ppt/presentation.xml"));   
    SlideLayoutPart layoutPart = (SlideLayoutPart)presentationMLPackage.getParts().getParts().get(
        new PartName("/ppt/slideLayouts/slideLayout1.xml"));
   
    // OK, now we can create a slide
    SlidePart slidePart = new SlidePart(new PartName("/ppt/slides/slide1.xml"));
    slidePart.setContents( SlidePart.createSld() );   
    pp.addSlide(0, slidePart);
   
    // Slide layout part
    slidePart.addTargetPart(layoutPart);
View Full Code Here

  public static PartName createPartName(URI partUri)
      throws InvalidFormatException {
    if (partUri == null)
      throw new IllegalArgumentException("partName");

    return new PartName(partUri, true);
  }
View Full Code Here

  }

  public Part CreateDefaultXmlPartObject(String partName)
      throws InvalidFormatException {
    return new DefaultXmlPart(new PartName(partName));
  }
View Full Code Here

    return new DefaultXmlPart(new PartName(partName));
  }
 
  public Part CreateMainDocumentPartObject(String partName)
      throws InvalidFormatException {
    return new MainDocumentPart(new PartName(partName));
  }
View Full Code Here

      throws InvalidFormatException {
    return new MainDocumentPart(new PartName(partName));
  }

  public Part CreateStyleDefinitionsPartObject(String partName) throws InvalidFormatException {
    return new StyleDefinitionsPart(new PartName(partName));
  }
View Full Code Here

    return new StyleDefinitionsPart(new PartName(partName));
  }

  public Part CreateDocumentSettingsPartObject(String partName)
      throws InvalidFormatException {
    return new DocumentSettingsPart(new PartName(partName));
  }
View Full Code Here

    return new DocumentSettingsPart(new PartName(partName));
  }

  public Part CreateWebSettingsPartObject(String partName)
      throws InvalidFormatException {
    return new WebSettingsPart(new PartName(partName));
  }
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.parts.PartName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.