Package org.apache.ofbiz.webapp.view
Class ApacheFopWorker
- java.lang.Object
-
- org.apache.ofbiz.webapp.view.ApacheFopWorker
-
public final class ApacheFopWorker extends java.lang.Object
Apache FOP worker class.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.fop.apps.Fop
createFopInstance(java.io.OutputStream out, java.lang.String outputFormat)
Returns a new Fop instance.static org.apache.fop.apps.Fop
createFopInstance(java.io.OutputStream out, java.lang.String outputFormat, org.apache.fop.apps.FOUserAgent foUserAgent)
Returns a new Fop instance.static java.io.File
createTempFoXmlFile()
Returns a temporary File instance.static java.io.File
createTempResultFile()
Returns a temporary File instance.static java.lang.String
getAllowAccessContentDefault()
static java.lang.String
getAllowAssembleDocumentDefault()
static java.lang.String
getAllowCopyContentDefault()
static java.lang.String
getAllowEditAnnotationsDefault()
static java.lang.String
getAllowEditContentDefault()
static java.lang.String
getAllowFillInFormsDefault()
static java.lang.String
getAllowPrintDefault()
static java.lang.String
getAllowPrintHqDefault()
static java.lang.String
getEncryptionLengthDefault()
static java.lang.String
getEncryptMetadataDefault()
static org.apache.fop.apps.FopFactory
getFactoryInstance()
Returns an instance of the FopFactory class.static java.lang.String
getOwnerPasswordDefault()
static java.lang.String
getUserPasswordDefault()
static void
transform(java.io.File srcFile, java.io.File destFile, java.io.File stylesheetFile, java.lang.String outputFormat)
Transform an xsl-fo file to the specified file format.static void
transform(java.io.InputStream srcStream, java.io.OutputStream destStream, java.io.InputStream stylesheetStream, java.lang.String outputFormat)
Transform an xsl-fo InputStream to the specified OutputStream format.static void
transform(javax.xml.transform.stream.StreamSource src, javax.xml.transform.stream.StreamSource stylesheet, org.apache.fop.apps.Fop fop)
Transform an xsl-fo StreamSource to the specified output format.
-
-
-
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 instancedestFile
- The target (result) File instancestylesheetFile
- Optional stylesheet File instanceoutputFormat
- 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 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(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 instancestylesheet
- Optional stylesheet StreamSource instancefop
-- 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 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(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 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
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()
-
-