Package org.docx4j.openpackaging.io

Examples of org.docx4j.openpackaging.io.SaveToZipFile.save()


    System.out.println(XmlUtils.marshaltoString(wmlPackage.getMainDocumentPart().getJaxbElement(), true, true));

    // Save it
    if (save) {
      SaveToZipFile saver = new SaveToZipFile(wmlPackage);
      saver.save(System.getProperty("user.dir") + "/OUT_VariablePrepare.docx");
      System.out.println("Saved");
    }
  }

}
View Full Code Here


   
    FromVariableReplacement migrator = new FromVariableReplacement();
    WordprocessingMLPackage pkgOut = migrator.migrate(pkgIn);
   
    SaveToZipFile saver = new SaveToZipFile(pkgOut);
    saver.save(outputfilepath);
   
  }

}
View Full Code Here

   
    FromMergeFields migrator = new FromMergeFields();
    WordprocessingMLPackage pkgOut = migrator.migrate(pkgIn);
   
    SaveToZipFile saver = new SaveToZipFile(pkgOut);
    saver.save(outputfilepath);
   
  }

}
View Full Code Here

   
    // Create WordprocessingMLPackage target, by cloning
    OpcPackage result = null;
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    SaveToZipFile saver = new SaveToZipFile(input);
    saver.save(baos);
    byte[] template = baos.toByteArray();
    WordprocessingMLPackage target = WordprocessingMLPackage.load(
        new ByteArrayInputStream(template));
   
   
View Full Code Here

   

    PresentationMLPackage pkg = creatorPptx.createSmartArtPkg(SlideSizesWellKnown.A3, true, doc);
   
    SaveToZipFile saver = new SaveToZipFile(pkg);
    saver.save(new File(System.getProperty("user.dir")+ "/OUT.pptx"  ) );
    System.out.println("Done!");
  }
}
View Full Code Here

     
      WordprocessingMLPackage resultPkg = (WordprocessingMLPackage)method.invoke(null, wmlPkgList);

      if (save) {   
        SaveToZipFile saver = new SaveToZipFile(resultPkg);
        saver.save(outputfilepath);
        System.out.println("Generated " + outputfilepath);
      } else {
        String result = XmlUtils.marshaltoString(resultPkg.getMainDocumentPart().getJaxbElement(), true, true);
        System.out.println(result);       
      }
View Full Code Here

   
    System.out.println(
        XmlUtils.marshaltoString(wordMLPackage.getMainDocumentPart().getJaxbElement(), true, true)
        );   
    SaveToZipFile saver = new SaveToZipFile(wordMLPackage);
    saver.save(filepathprefix + "_preprocessed.docx");
    System.out.println("Saved: " + filepathprefix + "_preprocessed.docx");
   
    // Apply the bindings
    BindingHandler.setHyperlinkStyle("Hyperlink");           
    startTime = System.currentTimeMillis();
View Full Code Here

    endTime = System.currentTimeMillis();
    timingSummary.append("\nBindingHandler.applyBindings: " + (endTime-startTime));
    String bound = XmlUtils.marshaltoString(wordMLPackage.getMainDocumentPart().getJaxbElement(), true, true);
    System.out.println(
        );
    saver.save(filepathprefix + "_bound.docx");
    System.out.println("Saved: " + filepathprefix + "_bound.docx");
   
    // process altChunk
    if (bound.contains("altChunk")) {
      try {
View Full Code Here

        endTime = System.currentTimeMillis();
        timingSummary.append("\nBindingHandler.applyBindings: " + (endTime-startTime));
        System.out.println(
            XmlUtils.marshaltoString(wordMLPackage.getMainDocumentPart().getJaxbElement(), true, true)
            );
        saver.save(filepathprefix + "_altChunksMerged.docx");
        System.out.println("Saved: " + filepathprefix + "_altChunksMerged.docx");
 
       
      } catch (ClassNotFoundException e) {
      } catch (NoSuchMethodException e) {
View Full Code Here

    RemovalHandler rh = new RemovalHandler();
    rh.removeSDTs(wordMLPackage, Quantifier.ALL);
    endTime = System.currentTimeMillis();
    timingSummary.append("\nRemovalHandler: " + (endTime-startTime));

    saver.save(filepathprefix + "_stripped.docx");
    System.out.println("Saved: " + filepathprefix + "_stripped.docx");
   
    System.out.println(timingSummary);
 
 
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.