Search in sources :

Example 1 with OpenDoPEReverter

use of org.docx4j.model.datastorage.OpenDoPEReverter in project Java-Tutorial by gpcodervn.

the class ContentControlBindingExtensions method reverter.

public static void reverter(String inputfilepath, String instancePath) throws Docx4JException {
    WordprocessingMLPackage instancePkg = WordprocessingMLPackage.load(new java.io.File(instancePath));
    OpenDoPEReverter reverter = new OpenDoPEReverter(WordprocessingMLPackage.load(new java.io.File(inputfilepath)), instancePkg);
    System.out.println("reverted? " + reverter.revert());
    SaveToZipFile saver = new SaveToZipFile(instancePkg);
    saver.save(filepathprefix + "_5_reverted.docx");
    System.out.println("Saved: " + filepathprefix + "_5_reverted.docx");
}
Also used : SaveToZipFile(org.docx4j.openpackaging.io.SaveToZipFile) WordprocessingMLPackage(org.docx4j.openpackaging.packages.WordprocessingMLPackage) File(java.io.File) SaveToZipFile(org.docx4j.openpackaging.io.SaveToZipFile) File(java.io.File) OpenDoPEReverter(org.docx4j.model.datastorage.OpenDoPEReverter)

Aggregations

File (java.io.File)1 OpenDoPEReverter (org.docx4j.model.datastorage.OpenDoPEReverter)1 SaveToZipFile (org.docx4j.openpackaging.io.SaveToZipFile)1 WordprocessingMLPackage (org.docx4j.openpackaging.packages.WordprocessingMLPackage)1