Use data uri scheme for company logo in PDF headers (OFBIZ-7327)

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Use data uri scheme for company logo in PDF headers (OFBIZ-7327)

Daniel Watford

I'd like to propose using the data uri scheme for images used in documents
generated using Apache FOP.

Issue highlights the
problem of displaying company logos in documents such as invoices, making
it difficult for administrators to customise the documents generated by

The cause of the problem appears to be that ofbiz now defaults to using
HTTPS, but URLs, created to access content uploaded to ofbiz will use HTTP.
Ofbiz responds to these content requests with a 301 Redirect which is not
handled by Apache FOP when resolving URLs.

One solution might be to ensure Apache FOP is configured with certificate
authority information, meaning it can access resources using the HTTPS
scheme, but this might be difficult to handle in cases involving localhost
or behind reverse-proxyies.

I suggest using the data-uri scheme (
to embed the data describing content, such as logo images, directly in the
XML processed by Apache FOP.

PR has implemented this
change, but I could do with others testing it out and making sure it
doesn't interfere with other ofbiz uses involving content, such as

I have tested with company logos up to 800KB without error.

To test with demo data, please use PartyMgr to upload a Logo Image for the
Company party as party content (

Then open invoice id 8010 (
and click the PDF button to generate an invoice.

Please let me know if you run into any problems or have any concerns about
using data-uris in this way.



Daniel Watford