Package org.docx4j.openpackaging.contenttype

Examples of org.docx4j.openpackaging.contenttype.CTOverride


   
    // Replace dotx content type with docx
    ContentTypeManager ctm = wordMLPackage.getContentTypeManager();
   
    // Get <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml"/>
    CTOverride override = ctm.getOverrideContentType().get(new URI("/word/document.xml")); // note this assumption
    if (dotx.endsWith("dotm")) // // macro enabled?     
    {
      override.setContentType(org.docx4j.openpackaging.contenttype.ContentTypes.WORDPROCESSINGML_DOCUMENT_MACROENABLED)
    } else {
      override.setContentType(org.docx4j.openpackaging.contenttype.ContentTypes.WORDPROCESSINGML_DOCUMENT)
    }
   
   
    if (attachTemplate) {
      // Create settings part, and init content
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.contenttype.CTOverride

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.