Package org.docx4j.finders

Examples of org.docx4j.finders.SectPrFinder


    }
   
    sections = new ArrayList<SectionWrapper>();
   
      // Find the sectPrs
      SectPrFinder sf = new SectPrFinder(wordMLPackage.getMainDocumentPart());
    try {
      new TraversalUtil(wordMLPackage.getMainDocumentPart().getContents(), sf);
    } catch (Docx4JException e) {
      log.error(e.getMessage(), e);
   
   
    for (SectPr sectPr : sf.getOrderedSectPrList() ) {
     
      SectionWrapper sw = new SectionWrapper(sectPr, previousHF, rels, evenAndOddHeaders);
      sections.add(sw);
      previousHF = sw.getHeaderFooterPolicy();
      log.debug( "registered sectpr");                 
View Full Code Here


     * @param hfPkg
     */
    static void trimContent(WordprocessingMLPackage hfPkg)   {
     
      // Find the sectPrs
      SectPrFinder sf = new SectPrFinder(hfPkg.getMainDocumentPart());
    try {
      new TraversalUtil(hfPkg.getMainDocumentPart().getContents(), sf);
    } catch (Docx4JException e) {
      // TODO Auto-generated catch block
      log.error(e.getMessage(), e);
   
   
    List<SectPr> sectPrList = sf.getSectPrList();
   
    // Was there a body level one?
    if (hfPkg.getMainDocumentPart().getJaxbElement().getBody().getSectPr()!=null) {
      //then delete the first entry (which is where SectPrFinder put it)
      sectPrList.remove(0)
View Full Code Here

        .load(f);
   
    MainDocumentPart mdp = wordMLPackage.getMainDocumentPart();
   
    // Remove from sectPr
    SectPrFinder finder = new SectPrFinder(mdp);
      new TraversalUtil(mdp.getContent(), finder);
      for (SectPr sectPr : finder.getSectPrList()) {
        sectPr.getEGHdrFtrReferences().clear();
      }
     
      // Remove rels
      List<Relationship> hfRels = new ArrayList<Relationship>();
View Full Code Here

TOP

Related Classes of org.docx4j.finders.SectPrFinder

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.