Class ApacheFopWorker


  • public final class ApacheFopWorker
    extends java.lang.Object
    Apache FOP worker class.
    • Field Detail

      • module

        public static final java.lang.String module
    • Method Detail

      • getFactoryInstance

        public static org.apache.fop.apps.FopFactory getFactoryInstance()
        Returns an instance of the FopFactory class. FOP documentation recommends the reuse of the factory instance because of the startup time.
        Returns:
        FopFactory The FopFactory instance
      • transform

        public static void transform​(java.io.File srcFile,
                                     java.io.File destFile,
                                     java.io.File stylesheetFile,
                                     java.lang.String outputFormat)
                              throws java.io.IOException,
                                     org.apache.fop.apps.FOPException
        Transform an xsl-fo file to the specified file format.
        Parameters:
        srcFile - The xsl-fo File instance
        destFile - The target (result) File instance
        stylesheetFile - Optional stylesheet File instance
        outputFormat - Optional output format, defaults to "application/pdf"
        Throws:
        java.io.IOException
        org.apache.fop.apps.FOPException
      • transform

        public static void transform​(java.io.InputStream srcStream,
                                     java.io.OutputStream destStream,
                                     java.io.InputStream stylesheetStream,
                                     java.lang.String outputFormat)
                              throws org.apache.fop.apps.FOPException
        Transform an xsl-fo InputStream to the specified OutputStream format.
        Parameters:
        srcStream - The xsl-fo InputStream instance
        destStream - The target (result) OutputStream instance
        stylesheetStream - Optional stylesheet InputStream instance
        outputFormat - Optional output format, defaults to "application/pdf"
        Throws:
        org.apache.fop.apps.FOPException
      • transform

        public static void transform​(javax.xml.transform.stream.StreamSource src,
                                     javax.xml.transform.stream.StreamSource stylesheet,
                                     org.apache.fop.apps.Fop fop)
                              throws org.apache.fop.apps.FOPException
        Transform an xsl-fo StreamSource to the specified output format.
        Parameters:
        src - The xsl-fo StreamSource instance
        stylesheet - Optional stylesheet StreamSource instance
        fop -
        Throws:
        org.apache.fop.apps.FOPException
      • createFopInstance

        public static org.apache.fop.apps.Fop createFopInstance​(java.io.OutputStream out,
                                                                java.lang.String outputFormat)
                                                         throws org.apache.fop.apps.FOPException
        Returns a new Fop instance. Note: FOP documentation recommends using a Fop instance for one transform run only.
        Parameters:
        out - The target (result) OutputStream instance
        outputFormat - Optional output format, defaults to "application/pdf"
        Returns:
        Fop instance
        Throws:
        org.apache.fop.apps.FOPException
      • createFopInstance

        public static org.apache.fop.apps.Fop createFopInstance​(java.io.OutputStream out,
                                                                java.lang.String outputFormat,
                                                                org.apache.fop.apps.FOUserAgent foUserAgent)
                                                         throws org.apache.fop.apps.FOPException
        Returns a new Fop instance. Note: FOP documentation recommends using a Fop instance for one transform run only.
        Parameters:
        out - The target (result) OutputStream instance
        outputFormat - Optional output format, defaults to "application/pdf"
        foUserAgent - FOUserAgent object which may contains encryption-params in render options
        Returns:
        Fop instance
        Throws:
        org.apache.fop.apps.FOPException
      • createTempFoXmlFile

        public static java.io.File createTempFoXmlFile()
                                                throws java.io.IOException
        Returns a temporary File instance. The temporary file name starts with tempFilePrefix and ends with ".xml". Calling methods are responsible for deleting the temporary file.

        FOP performs transforms in memory, so if there is any chance FO output will be more than a few pages, it would be best to keep FO input in a temporary file.

        Returns:
        File instance
        Throws:
        java.io.IOException
      • createTempResultFile

        public static java.io.File createTempResultFile()
                                                 throws java.io.IOException
        Returns a temporary File instance. The temporary file name starts with tempFilePrefix and ends with ".res". Calling methods are responsible for deleting the temporary file.

        FOP performs transforms in memory, so if there is any chance FO output will be more than a few pages, it would be best to keep FO output in a temporary file.

        Returns:
        File instance
        Throws:
        java.io.IOException
      • getEncryptionLengthDefault

        public static java.lang.String getEncryptionLengthDefault()
      • getUserPasswordDefault

        public static java.lang.String getUserPasswordDefault()
      • getOwnerPasswordDefault

        public static java.lang.String getOwnerPasswordDefault()
      • getAllowPrintDefault

        public static java.lang.String getAllowPrintDefault()
      • getAllowCopyContentDefault

        public static java.lang.String getAllowCopyContentDefault()
      • getAllowEditContentDefault

        public static java.lang.String getAllowEditContentDefault()
      • getAllowEditAnnotationsDefault

        public static java.lang.String getAllowEditAnnotationsDefault()
      • getAllowAccessContentDefault

        public static java.lang.String getAllowAccessContentDefault()
      • getAllowFillInFormsDefault

        public static java.lang.String getAllowFillInFormsDefault()
      • getAllowAssembleDocumentDefault

        public static java.lang.String getAllowAssembleDocumentDefault()
      • getAllowPrintHqDefault

        public static java.lang.String getAllowPrintHqDefault()
      • getEncryptMetadataDefault

        public static java.lang.String getEncryptMetadataDefault()