Package org.plutext.jaxb.xslfo

Examples of org.plutext.jaxb.xslfo.LayoutMasterSet


 
  private static org.plutext.jaxb.xslfo.ObjectFactory factory;
   
  public static DocumentFragment getLayoutMasterSetFragment(AbstractWmlConversionContext context) {

    LayoutMasterSet lms = getFoLayoutMasterSet(context)
   
    // Set suitable extents, for which we need area tree
    FOSettings foSettings = (FOSettings)context.getConversionSettings();
    if ( !foSettings.lsLayoutMasterSetCalculationInProgress()) // Avoid infinite loop
      // Can't just do it where foSettings.getApacheFopMime() is not MimeConstants.MIME_FOP_AREA_TREE,
View Full Code Here


     * @since 3.0
     *
     */ 
  public static void appendLayoutMasterSetFragment(AbstractWmlConversionContext context, Node foRoot) {

    LayoutMasterSet lms = getFoLayoutMasterSet(context)
   
    // Set suitable extents, for which we need area tree
    FOSettings foSettings = (FOSettings)context.getConversionSettings();
    if ( !foSettings.lsLayoutMasterSetCalculationInProgress()) // Avoid infinite loop
      // Can't just do it where foSettings.getApacheFopMime() is not MimeConstants.MIME_FOP_AREA_TREE,
View Full Code Here

 
  private static LayoutMasterSet getFoLayoutMasterSet(AbstractWmlConversionContext context) {
   
   
    LayoutMasterSet lms = getFactory().createLayoutMasterSet();
    List<ConversionSectionWrapper> sections = context.getSections().getList();
    ConversionSectionWrapper section = null;
   
    for(int i=0; i<sections.size(); i++) {
     
      section = sections.get(i);
      HeaderFooterPolicy hf = section.getHeaderFooterPolicy();
      String sectionName = "s" + Integer.toString(i + 1);
     
      // FIRST, create simple-page-masters
      // has first header or footer?
      if (hf.getFirstHeader()!=null || hf.getFirstFooter()!=null) {
        // per spec, HeaderFooterPolicy checks the titlePg elememt
       
        lms.getSimplePageMasterOrPageSequenceMaster().add(
          createSimplePageMaster(sectionName + "-firstpage",
              section.getPageDimensions(),
              "firstpage",
            (hf.getFirstHeader()!=null),
            (hf.getFirstFooter()!=null) ));
      }
     
      // has even or odd header or footer?
        /*
         *       <w:headerReference w:type="even" r:id="rId12"/>
         *       <w:headerReference w:type="default" r:id="rId13"/>
         *      
         *       the default one is treated as odd.
         */
      if (hf.getEvenHeader()!=null || hf.getEvenFooter()!=null) {
       
        lms.getSimplePageMasterOrPageSequenceMaster().add(
          createSimplePageMaster(sectionName + "-evenpage"
              section.getPageDimensions(),
              "evenpage",
            (hf.getEvenHeader()!=null),
            (hf.getEvenFooter()!=null) ));
       
        // the xslt outputs a "-default" page as the odd-page
      }
     
      if (hf.getDefaultHeader()!=null
          || hf.getDefaultFooter()!=null) {
       
        lms.getSimplePageMasterOrPageSequenceMaster().add(
          createSimplePageMaster(sectionName + "-default"
              section.getPageDimensions(),
              "default",
            (hf.getDefaultHeader()!=null),
            (hf.getDefaultFooter()!=null) ));       
      }

      // simple: no headers and footers - after the first page anyway/
      // We still need this where there is just a first page header/footer,
      // since otherwise there'd be no page sequence for any content
      // after the first page, and you'd get:
      //    org.apache.fop.fo.pagination.PageProductionException:
      //    Subsequences exhausted in page-sequence-master ..., cannot recover.
      //
      // <w:sectPr>
      //   <w:headerReference w:type="first" r:id="rId7"/>
      // </w:sectPr>     
      if (
        (hf.getDefaultHeader() == null) && (hf.getDefaultFooter() == null)) {
        lms.getSimplePageMasterOrPageSequenceMaster().add(
            createSimplePageMaster(sectionName + "-simple"
                section.getPageDimensions(),
                "simple",
              true, true));
      }
     
      // SECOND, create page-sequence-masters
      lms.getSimplePageMasterOrPageSequenceMaster().add(
          createPageSequenceMaster(hf, sectionName )  );
    }
   
    //
   
View Full Code Here

TOP

Related Classes of org.plutext.jaxb.xslfo.LayoutMasterSet

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.