Package org.docx4j.openpackaging.parts.WordprocessingML

Examples of org.docx4j.openpackaging.parts.WordprocessingML.ImagePngPart


  ExternalTarget externalTarget = new ExternalTarget(absoluteTarget);
  BinaryPart ret = null;
    if (ContentTypes.IMAGE_JPEG.equals(contentType))
      ret = new ImageJpegPart(externalTarget);
    else if (ContentTypes.IMAGE_PNG.equals(contentType))
        ret = new ImagePngPart(externalTarget);
    else if (ContentTypes.IMAGE_GIF.equals(contentType))
      ret = new ImageGifPart(externalTarget);
    else if (ContentTypes.IMAGE_TIFF.equals(contentType))
      ret = new ImageTiffPart(externalTarget);
    else if (ContentTypes.IMAGE_BMP.equals(contentType))
View Full Code Here


    return rel;
  }
 
  private void setHdr(HeaderPart headerPart) throws Exception  {
   
    ImagePngPart imagePart = new ImagePngPart(new PartName("/media/background.png"));
    imagePart.setBinaryData(image);
    Relationship rel = headerPart.addTargetPart(imagePart, AddPartBehaviour.REUSE_EXISTING); // the one image is shared by the 3 header parts
   
    String openXML = "<w:hdr mc:Ignorable=\"w14 wp14\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">"
              + "<w:p>"
                  + "<w:pPr>"
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.parts.WordprocessingML.ImagePngPart

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.