Examples of FOSettings


Examples of org.docx4j.convert.out.FOSettings

    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
    wordMLPackage.getMainDocumentPart().setJaxbElement(
        (Document)XmlUtils.unmarshalString(table1XML));   
   
   
      FOSettings foSettings = Docx4J.createFOSettings();
    foSettings.setWmlPackage(wordMLPackage);
   
    OutputStream os = null;
    if (save) {
     
      os = new FileOutputStream(new File(System.getProperty("user.dir") + "/OUT_testTblIndentInheritance.pdf"));
      wordMLPackage.save(new File(System.getProperty("user.dir") + "/OUT_testTblIndentInheritance.docx"));
    } else {
      // want the fo document as the result.
      foSettings.setApacheFopMime(FOSettings.INTERNAL_FO_MIME);
     
      // exporter writes to an OutputStream.   
      os = new ByteArrayOutputStream();
    }
   
View Full Code Here

Examples of org.docx4j.convert.out.FOSettings

    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
    wordMLPackage.getMainDocumentPart().setJaxbElement(
        (Document)XmlUtils.unmarshalString(table1XML));   
   
   
      FOSettings foSettings = Docx4J.createFOSettings();
    foSettings.setWmlPackage(wordMLPackage);
   
    OutputStream os = null;
    if (save) {
     
      os = new FileOutputStream(new File(System.getProperty("user.dir") + "/OUT_testTblIndentOnCentredTable.pdf"));
      wordMLPackage.save(new File(System.getProperty("user.dir") + "/OUT_testTblIndentOnCentredTable.docx"));
    } else {
      // want the fo document as the result.
      foSettings.setApacheFopMime(FOSettings.INTERNAL_FO_MIME);
     
      // exporter writes to an OutputStream.   
      os = new ByteArrayOutputStream();
    }
   
View Full Code Here

Examples of org.docx4j.convert.out.FOSettings

  public  void testTblHeaderOne() throws Exception {
   
    String inputfilepath = System.getProperty("user.dir") + "/src/test/resources/tables/tblHeaderTestOne.docx";
    WordprocessingMLPackage wordMLPackage= WordprocessingMLPackage.load(new java.io.File(inputfilepath))
   
      FOSettings foSettings = Docx4J.createFOSettings();
    foSettings.setWmlPackage(wordMLPackage);
   
    // want the fo document as the result.
    foSettings.setApacheFopMime(FOSettings.INTERNAL_FO_MIME);
   
    // exporter writes to an OutputStream.   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
     
View Full Code Here

Examples of org.docx4j.convert.out.FOSettings

  public  void testTblHeaderTwo() throws Exception {
   
    String inputfilepath = System.getProperty("user.dir") + "/src/test/resources/tables/tblHeaderTestTwo.docx";
    WordprocessingMLPackage wordMLPackage= WordprocessingMLPackage.load(new java.io.File(inputfilepath))
   
      FOSettings foSettings = Docx4J.createFOSettings();
    foSettings.setWmlPackage(wordMLPackage);
   
    // want the fo document as the result.
    foSettings.setApacheFopMime(FOSettings.INTERNAL_FO_MIME);
   
    // exporter writes to an OutputStream.   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
     
View Full Code Here

Examples of org.docx4j.convert.out.FOSettings

    // FO
    if (fo) {
     
      OutputStream baos = new ByteArrayOutputStream();
      Exporter<FOSettings> exporter = FOExporterVisitor.getInstance();
      FOSettings settings = new FOSettings();
      settings.setWmlPackage(wordMLPackage);
      settings.setApacheFopMime(FOSettings.INTERNAL_FO_MIME);
      exporter.export(settings, baos);
     
      System.out.println( ((ByteArrayOutputStream) baos).toString("UTF-8"));
     
    } else {
View Full Code Here

Examples of org.docx4j.convert.out.FOSettings

  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,
      // since TOC functionality uses that.
    {
      fixExtents( lms, context, true);
    }
View Full Code Here

Examples of org.docx4j.convert.out.FOSettings

  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,
      // since TOC functionality uses that.
    {
      fixExtents( lms, context, false);
    }
View Full Code Here

Examples of org.docx4j.convert.out.FOSettings

      OutputStream os = new java.io.FileOutputStream(
                inputfilepath + Thread.currentThread().getName() + ".pdf")
     
      // FO exporter setup (required)
      // .. the FOSettings object
        FOSettings foSettings = Docx4J.createFOSettings();
      foSettings.setWmlPackage(wordMLPackage);     
     
      Docx4J.toFO(foSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL);     
      System.out.println("Saved " + inputfilepath + Thread.currentThread().getName() + ".pdf");

     } catch (InterruptedException e) {
View Full Code Here

Examples of org.docx4j.convert.out.FOSettings

    + "/sample-docs/word/sample-docxv2.docx";   
   
    WordprocessingMLPackage wmlPackage = WordprocessingMLPackage
        .load(new java.io.File(inputfilepath));
   
    FOSettings pdfSettings = new FOSettings();
    pdfSettings.setWmlPackage(wmlPackage);
   
   
    XSLFOExporterNonXSLT withoutXSLT = new XSLFOExporterNonXSLT(wmlPackage,
        pdfSettings);   
//    new PDFConversionImageHandler(settings.getImageDirPath(), true) :
View Full Code Here

Examples of org.docx4j.convert.out.FOSettings

    }
    fontMapper.put("Libian SC Regular", PhysicalFonts.get("SimSun"));

    // FO exporter setup (required)
    // .. the FOSettings object
      FOSettings foSettings = Docx4J.createFOSettings();
    if (saveFO) {
      foSettings.setFoDumpFile(new java.io.File(inputfilepath + ".fo"));
    }
    foSettings.setWmlPackage(wordMLPackage);
   
    // 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)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.