LinuxCommandLibrary

fop

TLDR

Convert XSL-FO to PDF

$ fop [input.fo] [output.pdf]
copy
Transform XML with XSLT to PDF
$ fop -xml [input.xml] -xsl [style.xsl] -pdf [output.pdf]
copy
Convert to PostScript
$ fop [input.fo] -ps [output.ps]
copy
Convert to PNG
$ fop [input.fo] -png [output.png]
copy
Use specific configuration
$ fop -c [fop.xconf] [input.fo] [output.pdf]
copy
Validate XSL-FO only
$ fop -fo [input.fo] -v
copy

SYNOPSIS

fop [options] [input] [output]

DESCRIPTION

fop (Formatting Objects Processor) is an Apache project that converts XSL-FO (XSL Formatting Objects) documents to various output formats. It's commonly used for generating PDFs from XML data.
The tool supports transformation pipelines from XML through XSLT to XSL-FO to final output. It handles complex page layouts, tables, and typography.

PARAMETERS

-fo file

Input XSL-FO file.
-xml file
Input XML file.
-xsl file
XSLT stylesheet.
-pdf file
Output to PDF.
-ps file
Output to PostScript.
-png file
Output to PNG.
-awt
Display in AWT viewer.
-c file
Configuration file.
-v
Verbose output.
-d
Debug mode.

CAVEATS

Requires Java. Complex layouts may need tuning. Memory usage high for large documents. Font configuration can be tricky.

HISTORY

FOP began as an Apache XML project in 1999, becoming one of the first open source XSL-FO processors. It matured through various versions, with FOP 2.x bringing significant improvements in standards compliance and performance.

SEE ALSO

Copied to clipboard