Package org.apache.ofbiz.webapp.view
Class ApacheFopWorker
java.lang.Object
org.apache.ofbiz.webapp.view.ApacheFopWorker
Apache FOP worker class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.fop.apps.Fop
createFopInstance
(OutputStream out, String outputFormat) Returns a new Fop instance.static org.apache.fop.apps.Fop
createFopInstance
(OutputStream out, String outputFormat, org.apache.fop.apps.FOUserAgent foUserAgent) Returns a new Fop instance.static File
Returns a temporary File instance.static File
Returns a temporary File instance.static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static org.apache.fop.apps.FopFactory
Returns an instance of the FopFactory class.static String
static String
static void
Transform an xsl-fo file to the specified file format.static void
transform
(InputStream srcStream, OutputStream destStream, InputStream stylesheetStream, String outputFormat) Transform an xsl-fo InputStream to the specified OutputStream format.static void
transform
(StreamSource src, StreamSource stylesheet, org.apache.fop.apps.Fop fop) Transform an xsl-fo StreamSource to the specified output format.
-
Method Details
-
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(File srcFile, File destFile, File stylesheetFile, String outputFormat) throws IOException, org.apache.fop.apps.FOPException Transform an xsl-fo file to the specified file format.- Parameters:
srcFile
- The xsl-fo File instancedestFile
- The target (result) File instancestylesheetFile
- Optional stylesheet File instanceoutputFormat
- Optional output format, defaults to "application/pdf"- Throws:
IOException
org.apache.fop.apps.FOPException
-
transform
public static void transform(InputStream srcStream, OutputStream destStream, InputStream stylesheetStream, String outputFormat) throws org.apache.fop.apps.FOPException Transform an xsl-fo InputStream to the specified OutputStream format.- Parameters:
srcStream
- The xsl-fo InputStream instancedestStream
- The target (result) OutputStream instancestylesheetStream
- Optional stylesheet InputStream instanceoutputFormat
- Optional output format, defaults to "application/pdf"- Throws:
org.apache.fop.apps.FOPException
-
transform
public static void transform(StreamSource src, 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 instancestylesheet
- Optional stylesheet StreamSource instancefop
-- Throws:
org.apache.fop.apps.FOPException
-
createFopInstance
public static org.apache.fop.apps.Fop createFopInstance(OutputStream out, 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 instanceoutputFormat
- 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(OutputStream out, 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 instanceoutputFormat
- 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
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:
IOException
-
createTempResultFile
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:
IOException
-
getEncryptionLengthDefault
-
getUserPasswordDefault
-
getOwnerPasswordDefault
-
getAllowPrintDefault
-
getAllowCopyContentDefault
-
getAllowEditContentDefault
-
getAllowEditAnnotationsDefault
-
getAllowAccessContentDefault
-
getAllowFillInFormsDefault
-
getAllowAssembleDocumentDefault
-
getAllowPrintHqDefault
-
getEncryptMetadataDefault
-