Examples of CTAltChunk


Examples of org.docx4j.wml.CTAltChunk

     
      // now that its attached to the package ..
      afiPart.registerInContentTypeManager();
     
 
      CTAltChunk ac = Context.getWmlObjectFactory()
          .createCTAltChunk();
      ac.setId(altChunkRel.getId());

      // This setting makes no difference in that the altChunk
      // still won't use the style from the containing docx
      // if it isn't in the styles part in the altChunk!
     
View Full Code Here

Examples of org.docx4j.wml.CTAltChunk

        afiPart.setContentType(new ContentType(
            "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml")); // docx

        Relationship altChunkRel = srcPackage.getMainDocumentPart()
            .addTargetPart(afiPart);
        CTAltChunk ac = Context.getWmlObjectFactory()
            .createCTAltChunk();
        ac.setId(altChunkRel.getId());

        replacements.put(index, ac);

        /*
         * 2011 12 11 TODO.  Rethink support for
View Full Code Here

Examples of org.docx4j.wml.CTAltChunk

    afiPart.registerInContentTypeManager();
   
    afiPart.setBinaryData(bytes);    
   
    // .. the bit in document body
    CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk();
    ac.setId(altChunkRel.getId() );
    if (this instanceof ContentAccessor) {
     ((ContentAccessor)this).getContent().add(ac);
    } else {
      throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor");
    }
View Full Code Here

Examples of org.docx4j.wml.CTAltChunk

    afiPart.registerInContentTypeManager();   
   
    afiPart.setBinaryData(is);
   
    // .. the bit in document body
    CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk();
    ac.setId(altChunkRel.getId() );
    if (this instanceof ContentAccessor) {
     ((ContentAccessor)this).getContent().add(ac);
    } else {
      throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor");
    }
View Full Code Here

Examples of org.docx4j.wml.CTAltChunk

    afiPart.registerInContentTypeManager();
   
    afiPart.setBinaryData(bytes);    
   
    // .. the bit in document body
    CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk();
    ac.setId(altChunkRel.getId() );
    attachmentPoint.getContent().add(ac);
         
    return afiPart;
  }
View Full Code Here

Examples of org.docx4j.wml.CTAltChunk

    afiPart.registerInContentTypeManager();   
   
    afiPart.setBinaryData(is);
   
    // .. the bit in document body
    CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk();
    ac.setId(altChunkRel.getId() );
    attachmentPoint.getContent().add(ac);
         
    return afiPart;
  }
View Full Code Here

Examples of org.docx4j.wml.CTAltChunk

    List<Object> contentList = ((ContentAccessor)clonedPart).getContent();
   
      AltChunkFinder bf = new AltChunkFinder();
    new TraversalUtil(contentList, bf);

    CTAltChunk altChunk;
    boolean encounteredDocxAltChunk = false;
    for (LocatedChunk locatedChunk : bf.getAltChunks()) {
     
      altChunk = locatedChunk.getAltChunk();
      AlternativeFormatInputPart afip
        =  (AlternativeFormatInputPart)clonedPart.getRelationshipsPart().getPart(
            altChunk.getId() );
     
      // Can we process it?
      AltChunkType type = afip.getAltChunkType();

      if (type.equals(AltChunkType.Xhtml) ) {
View Full Code Here

Examples of org.docx4j.wml.CTAltChunk

        try {
            AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(new PartName("/" + UUID.randomUUID().toString() + ".html"));
            afiPart.setBinaryData(paramValue.toString().getBytes());
            afiPart.setContentType(new ContentType("text/html"));
            Relationship altChunkRel = wordPackage.getMainDocumentPart().addTargetPart(afiPart);
            CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk();
            ac.setId(altChunkRel.getId());
            R run = (R) text.getParent();
            run.getContent().add(ac);
            text.setValue("");
            wordPackage.getContentTypeManager().addDefaultContentType("html", "text/html");
        } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.