Package org.docx4j.convert.out

Examples of org.docx4j.convert.out.FOSettings


   
    static org.w3c.dom.Document getAreaTreeViaFOP(WordprocessingMLPackage hfPkg, boolean useXSLT) throws Docx4JException, ParserConfigurationException, SAXException, IOException  {

        // Currently FOP dependent!  But an Antenna House version ought to be feasible.
     
        FOSettings foSettings = Docx4J.createFOSettings();
        foSettings.setWmlPackage(hfPkg);
        foSettings.setApacheFopMime(MimeConstants.MIME_FOP_AREA_TREE);
       
        foSettings.setLayoutMasterSetCalculationInProgress(true); // avoid recursion
       
//        foSettings.getFeatures().add(ConversionFeatures.PP_PDF_APACHEFOP_DISABLE_PAGEBREAK_LIST_ITEM); // in 3.0.1, this is off by default
       
        if (log.isDebugEnabled()) {
          foSettings.setFoDumpFile(new java.io.File(System.getProperty("user.dir") + "/hf.fo"));
        }

        ByteArrayOutputStream os = new ByteArrayOutputStream();
       
        if (useXSLT) {
View Full Code Here


      boolean saveFO = false;
      String outputfilepath = System.getProperty("user.dir") "/OUT_CompareDocuments.pdf";
     
      // FO exporter setup (required)
      // .. the FOSettings object
        FOSettings foSettings = Docx4J.createFOSettings();
      if (saveFO) {
        foSettings.setFoDumpFile(new java.io.File(System.getProperty("user.dir") "/OUT_CompareDocuments..fo"));
      }
      foSettings.setWmlPackage(newerPackage);
      // Document format:
      // The default implementation of the FORenderer that uses Apache Fop will output
      // a PDF document if nothing is passed via
      // foSettings.setApacheFopMime(apacheFopMime)
      // apacheFopMime can be any of the output formats defined in org.apache.fop.apps.MimeConstants or
View Full Code Here

 
  /**
   *  Create the configuration object for conversions that are done via xsl-fo
   */ 
  public static FOSettings createFOSettings() {
    return new FOSettings();
  }
View Full Code Here

  public static void toPDF(WordprocessingMLPackage wmlPackage, OutputStream outputStream) throws Docx4JException {
   
    StartEvent startEvent = new StartEvent( wmlPackage, WellKnownProcessSteps.PDF );
    startEvent.publish();
   
    FOSettings settings = createFOSettings();
    settings.setWmlPackage(wmlPackage);
    settings.setApacheFopMime("application/pdf");
    toFO(settings, outputStream, FLAG_NONE);
   
    new EventFinished(startEvent).publish();
  }
View Full Code Here

TOP

Related Classes of org.docx4j.convert.out.FOSettings

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.