Package org.apache.maven.doxia.module.fo
Class FoUtils
java.lang.Object
org.apache.maven.doxia.module.fo.FoUtils
FO Sink utilities.- Since:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final TransformerFactoryTo reuse the TransformerFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconvertFO2PDF(File fo, File pdf, String resourceDir) Converts an FO file to a PDF file using FOP.static voidconvertFO2PDF(File fo, File pdf, String resourceDir, DocumentModel documentModel) Converts an FO file to a PDF file using FOP.private static URIgetBaseURI(File fo, String resourceDir) Returns a base URI.private static voidprepareUserAgent(org.apache.fop.apps.FOUserAgent foUserAgent, DocumentModel documentModel)
-
Field Details
-
TRANSFORMER_FACTORY
To reuse the TransformerFactory
-
-
Constructor Details
-
FoUtils
private FoUtils()
-
-
Method Details
-
prepareUserAgent
private static void prepareUserAgent(org.apache.fop.apps.FOUserAgent foUserAgent, DocumentModel documentModel) -
convertFO2PDF
public static void convertFO2PDF(File fo, File pdf, String resourceDir, DocumentModel documentModel) throws TransformerException Converts an FO file to a PDF file using FOP.- Parameters:
fo- the FO file, not null.pdf- the target PDF file, not null.resourceDir- The base directory for relative path resolution, could be null. If null, defaults to the parent directory of fo.documentModel- the document model to add PDF metadatas like author, title and keywords, could be null.- Throws:
TransformerException- In case of a conversion problem.- Since:
- 1.1.1
-
convertFO2PDF
Converts an FO file to a PDF file using FOP.- Parameters:
fo- the FO file, not null.pdf- the target PDF file, not null.resourceDir- The base directory for relative path resolution, could be null. If null, defaults to the parent directory of fo.- Throws:
TransformerException- In case of a conversion problem.- See Also:
-
getBaseURI
Returns a base URI.- Parameters:
fo- the FO file.resourceDir- the resource directory.- Returns:
- URI.
-