Examples of parseContentTypesFile()


Examples of org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile()

    String path_in = System.getProperty("user.dir") + "/src/test/resources/parts/";
   
    // Need to know how what type of part to map to   
    InputStream in = new FileInputStream(path_in + "[Content_Types].xml");
    ContentTypeManager externalCtm = new ContentTypeManager();
    externalCtm.parseContentTypesFile(in);
   
    // Example of a part which become a rel of the word document
    in = new FileInputStream(path_in + "settings.xml");
    attachForeignPart(wordMLPackage, wordMLPackage.getMainDocumentPart(),
        externalCtm, "word/settings.xml", in);
View Full Code Here

Examples of org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile()

      Alterations alterations) throws Docx4JException, JAXBException {
   
    if (alterations.getContentTypes()!=null) {
      log.info("replacing [Content_Types].xml");
      ContentTypeManager newCTM = new ContentTypeManager();
      newCTM.parseContentTypesFile(
          new ByteArrayInputStream(alterations.getContentTypes()));
      otherPackage.setContentTypeManager(newCTM);
    }
   
    if (alterations.isEmpty() ) return;
View Full Code Here

Examples of org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile()

    // 1. Get [Content_Types].xml
    ContentTypeManager ctm = new ContentTypeManager();
    InputStream is = null;
    try {
      is = partStore.loadPart("[Content_Types].xml");   
      ctm.parseContentTypesFile(is);
    } catch (Docx4JException e) {
      throw new Docx4JException("Couldn't get [Content_Types].xml from ZipFile", e);
    } catch (NullPointerException e) {
      throw new Docx4JException("Couldn't get [Content_Types].xml from ZipFile", e);
    } finally {
View Full Code Here

Examples of org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile()

   
    ContentTypeManager ctm = new ContentTypeManager();

    try {
      InputStream is = getInputStreamFromZippedPart( partByteArrays,  "[Content_Types].xml");   
      ctm.parseContentTypesFile(is);
    } catch (IOException e) {
      throw new Docx4JException("Couldn't get [Content_Types].xml from ZipFile", e);
    } catch (NullPointerException e) {
      throw new Docx4JException("Couldn't get [Content_Types].xml from ZipFile", 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.