Yes, there is a difference. By default FOP uses a "native" image loader for JPG but not for PNG. There is however a native image loader for PNG too, which you can enable in the configuration file. See http://wiki.apache.org/xmlgraphics-fop/HowTo/ImageLoaderRawPNG for more info. Try it and I expect that you will see a performance improvement.

Native image loaders process the image differently and usually do it faster. The reason the native image loader for PNG is not enabled by default is because it does not support all types of PNG images, but supports the most common, so very likely it will work with your images too.

Why is PNG more expensive than JPG to process? One reason is transparency, which JPG does not support. To embed a PNG in PDF the transparency bytes have to be separated from the RGB bytes, and then both are embedded in the PDF as separated components. The other reason is compression. When not using the native image loader, the PNG image needs to be uncompressed and converted to a "plain" RGB bitmap. This process can be very expensive.

On 10/16/13 7:39 PM, Roberto Cahanap wrote:

Hello everyone.

We have been trying to figure out why our pdf generation was taking so long.

When we changed an image in the PDF from PNG to JPG, then it was much faster.

Is there a difference in the way these two graphic formats are processed in FOP?

Thank you for your responses.

-Roberto

The information transmitted in this email and any of its attachments is intended only for the person or entity to which it is addressed and may contain BioReference Laboratories proprietary information, which is privileged, confidential, or subject to copyright belonging to BioReference Laboratories. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited and may be unlawful. If you received this in error, please contact the sender immediately and delete and destroy the communication and all of the attachments you have received and all copies thereof.


Reply via email to