Run fop.jar in as Executable


How to run fop.jar in an executable jar?



fop.jar in has "Main-Class: org.apache.fop.cli.Main" specified in the manifest file. You can run fop.jar as an executable jar as shown below:

\fyicenter>cd \local\fop-2.0

\local\fop-2.0>echo %java_home%
   \Program Files\Java\jdk1.8.0_45\

\local\fop-2.0>java -jar \local\fop-2.0\build\fop.jar 
   -imagein examples\fo\graphics\listgeometry.gif 

... processEvent
INFO: Rendered page #1.

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

The output PDF file is located at \temp\listgeometry.pdf. Open it with a PDF viewer, you will see something like this:

Back to FAQ on FOP (Formatting Objects Processor).

2016-07-05, 898👍, 0💬