Call org.apache.fop.cli.Main in fop.jar


What is the main class in FOP JAR file to run FOP as an standalone application?



The main class to run FOP as an standalone application is org.apache.fop.cli.Main. "cli" is the abbreviation of "command line interface". Here is how to start org.apache.fop.cli.Main with the "java" command:

\fyicenter>cd \local\fop-2.2\fop

\local\fop-2.2\fop>java -cp build\fop.jar 
   org.apache.fop.cli.Main -imagein examples\fo\graphics\linux.bmp 

... processEvent
INFO: Rendered page #1.

The above command uses FOP to convert an image file in BMP format into a PDF directly.

The output PDF file is located at \temp\linux.pdf. Open it with a PDF viewer, you will see something like this:
FOP Example - Convert BMP to PDF

The same example is provided in FOP 2.2, 2.1, and 2.0.


⇒ Call FOP with Debug Logging

⇐ Run fop.jar in FOP as Executable

⇑ FOP Commands and Examples

⇑⇑ FAQ for FOP (Formatting Object Processor)

2015-11-26, 2095👍, 0💬