Run fop.jar in FOP as Executable

Q

How to run fop.jar in FOP an executable jar?

✍: FYIcenter.com

A

fop.jar in FOP 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.2\fop

fyicenter> java -jar 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 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:
FOP Example - Convert GIF to PDF

 

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

Transform XML to FO and Generate PDF with FOP

FOP Commands and Examples

⇑⇑ FAQ for FOP (Formatting Object Processor)

2016-07-05, 2886🔥, 0💬