Run fop.jar in fop-2.0-bin.zip as Executable

Q

How to run fop.jar in fop-2.0-bin.zip an executable jar?

✍: FYIcenter.com

A

fop.jar in fop-2.0-bin.zip 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 
   \temp\listgeometry.pdf

... org.apache.fop.events.LoggingEventListener 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💬