Package org.docx4j.model.datastorage

Examples of org.docx4j.model.datastorage.RemovalHandler


    // you can't do both. So comment out one or the other.
//    reverter(inputfilepath, filepathprefix + "_bound.docx");
//   
    // Strip content controls
    startTime = System.currentTimeMillis();
    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");
View Full Code Here


   */ 
  public static void bind(WordprocessingMLPackage wmlPackage, Document xmlDocument, int flags) throws Docx4JException {
   
    OpenDoPEHandler  openDoPEHandler = null;
    CustomXmlDataStoragePart customXmlDataStoragePart = null;
    RemovalHandler removalHandler = null;
    //String xpathStorageItemId = null;
   
    AtomicInteger bookmarkId = null;

    if (flags == FLAG_NONE) {
View Full Code Here

    }
    return (visitor != null ? visitor.getdefinedStoreItemId() : null);
  }

  protected static void removeSDTs(WordprocessingMLPackage wmlPackage)throws Docx4JException {
  RemovalHandler removalHandler;
  removalHandler = new RemovalHandler();
  removalHandler.removeSDTs(wmlPackage.getMainDocumentPart(), RemovalHandler.Quantifier.ALL, (String[])null);
    for (Part part:wmlPackage.getParts().getParts().values()) {
      if (part instanceof HeaderPart) {
        removalHandler.removeSDTs((HeaderPart)part, RemovalHandler.Quantifier.ALL, (String[])null);
      }
      else if (part instanceof FooterPart) {
        removalHandler.removeSDTs((FooterPart)part, RemovalHandler.Quantifier.ALL, (String[])null);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.docx4j.model.datastorage.RemovalHandler

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.