Package org.docx4j.wml

Examples of org.docx4j.wml.SectPr$Type


    }
   
    Object o = body.getContent().get(0);
   
    if (o instanceof P) {
      SectPr sectPr = cutSectPr((P)o);
     
      if (sectPr!=null) {
        pasteSectPr(body.getContent(), sectPr);
        log.info("Moved sectPr to new P");
        return;
      }
     
    } else if (o instanceof SdtElement) {
      Object o2 = ((SdtElement)o).getSdtContent().getContent().get(0);
     
      if (o2!=null && o2 instanceof P) {

        SectPr sectPr = cutSectPr((P)o2);
       
        if (sectPr!=null) {
          pasteSectPr(((SdtElement)o).getSdtContent().getContent(), sectPr);
          log.info("Moved sectPr to new P inside content control");
          return;
View Full Code Here


  private static  SectPr cutSectPr(P p) {
   
    if (p.getPPr()!=null
        && p.getPPr().getSectPr()!=null) {
     
      SectPr sectPr = p.getPPr().getSectPr();
      p.getPPr().setSectPr(null);
      return sectPr;
     
    }
    return null;
View Full Code Here

             * 2. still use the headers/footers from this section
             * 
             */
           
            boolean ignoreThisSection = false;
            SectPr followingSectPr = sectPrs.get(++sectPrIndex);
            if ( followingSectPr.getType()!=null
                     && followingSectPr.getType().getVal().equals("continuous")) {

              log.info("following sectPr is continuous; this section wrapper must include its contents ");
              ignoreThisSection = true;
             
            }
           
           
            if (ignoreThisSection) {
              // In case there are some headers/footers that apply to both this content and the
              // content before the continuous sectPr,
              // or that need to get inherited by the section after the continuous sectPr
              previousHF = new HeaderFooterPolicy(ppr.getSectPr(), previousHF, rels, evenAndOddHeaders);

             
              PgSz pgSzThis = ppr.getSectPr().getPgSz();
              PgSz pgSzNext = followingSectPr.getPgSz();
              if (insertPageBreak( pgSzThis,  pgSzNext)) {
               
                ppr.setPageBreakBefore(new BooleanDefaultTrue());
              }
              //ppr.setSectPr(null); // Don't do this, since we have to process the docx (inc sectPrs) multiple times for a single PDF output
View Full Code Here

            && ((P) last).getPPr()!=null
              && ((P) last).getPPr().getSectPr() !=null) {
            // ok
        log.debug(".. but last p contains sectPr .. move it"); // so our assumption later about there being a following section is correct

        SectPr thisSectPr = ((P) last).getPPr().getSectPr();
        document.getBody().setSectPr(thisSectPr);
        ((P) last).getPPr().setSectPr(null);
        sectPrs.remove(thisSectPr);
       
        } else {     
View Full Code Here

    List mainContent = output.getMainDocumentPart().getContent();
   
    // Add a sectPr   
    org.docx4j.wml.P  par = objectFactory.createP();
    mainContent.add(0,par);
    SectPr sectPr = objectFactory.createSectPr();
    PPr ppr = objectFactory.createPPr();
    ppr.setSectPr(sectPr);
    par.setPPr(ppr);
   
   
    // From the spec, if this element is set to true and the
    // first page header type is omitted, then a blank header
    // shall be created as needed
    sectPr.setTitlePg(new BooleanDefaultTrue());
   
    // Set nextPage on the *next* (!) section
//    output.getDocumentModel().refresh();
//    List<SectionWrapper> sections = output.getDocumentModel().getSections();
//    SectPr nextSectPr = sections.get(1).getSectPr();
View Full Code Here

      Relationship relationship )
      throws InvalidFormatException {

    List<SectionWrapper> sections = wordprocessingMLPackage.getDocumentModel().getSections();
      
    SectPr sectPr = sections.get(sections.size() - 1).getSectPr();
    // There is always a section wrapper, but it might not contain a sectPr
    if (sectPr==null ) {
      sectPr = factory.createSectPr();
      wordprocessingMLPackage.getMainDocumentPart().addObject(sectPr);
      sections.get(sections.size() - 1).setSectPr(sectPr);
    }

    HeaderReference headerReference = factory.createHeaderReference();
    headerReference.setId(relationship.getId());
    headerReference.setType(HdrFtrRef.DEFAULT);
    sectPr.getEGHdrFtrReferences().add(headerReference);

  }
View Full Code Here

   
    // Create a basic sectPr using our Page model
    PageDimensions page = new PageDimensions();
    page.setPgSize(sz, landscape);
   
    SectPr sectPr = factory.createSectPr();
    body.setSectPr(sectPr);
    sectPr.setPgSzpage.getPgSz() );
    sectPr.setPgMar( page.getPgMar() );
       
    // Put the content in the part
    wordDocumentPart.setJaxbElement(wmlDocumentEl);
           
    // Add the main document part to the package relationships
View Full Code Here

      Relationship relationship )
      throws InvalidFormatException {

    List<SectionWrapper> sections = wordprocessingMLPackage.getDocumentModel().getSections();
      
    SectPr sectPr = sections.get(sections.size() - 1).getSectPr();
    // There is always a section wrapper, but it might not contain a sectPr
    if (sectPr==null ) {
      sectPr = objectFactory.createSectPr();
      wordprocessingMLPackage.getMainDocumentPart().addObject(sectPr);
      sections.get(sections.size() - 1).setSectPr(sectPr);
    }

    HeaderReference headerReference = objectFactory.createHeaderReference();
    headerReference.setId(relationship.getId());
    headerReference.setType(HdrFtrRef.DEFAULT);
    sectPr.getEGHdrFtrReferences().add(headerReference);// add header or
    // footer references

  }
View Full Code Here

                    type,
                    MetafacadeConstants.NAMESPACE_SCOPE_OPERATOR,
                    true);
            if (modelElement instanceof Type)
            {
                Type element = (Type)modelElement;
                final Property property = umlClass.createOwnedAttribute(
                        name,
                        element,
                        1,
                        1);
View Full Code Here

        }
        boolean isEntityAssociation = true;
        for (Iterator ends = ((Association)this.metaObject).getMemberEnds().iterator(); ends.hasNext();)
        {
            final Property prop = (Property)ends.next();
            final Type propertyType = prop.getType();
            if (propertyType == null || !UmlUtilities.containsStereotype(
                    propertyType,
                    UMLProfile.STEREOTYPE_ENTITY))
            {
                isEntityAssociation = false;
View Full Code Here

TOP

Related Classes of org.docx4j.wml.SectPr$Type

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.