xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulrich Mayring <u...@denic.de>
Subject Ideas needed: insert byte[] into XSLFO
Date Tue, 06 Mar 2018 16:08:43 GMT

Hi all,

I have a byte[] (basically, a PNG or JPG image) that I generated myself
and would like to insert it in an XSLFO page at a certain position and
render the page to PDF with fop.

Think of it like a letter with a logo, only that the logo is dynamically

The best way to insert it seems to be fo:external-graphic, but that
requires a url, from where the resource is acquired.

I don't want to save my image to disk or put it on a webserver, so my
idea is to somehow make a custom URIResolver, which would supply my
generated image(s).

My question is how do I wire this up into my existing fop workflow,
which looks like this:

FOUserAgent userAgent = fopFactory.newFOUserAgent();
Fop fop = fopFactory.newFop(mimeType, userAgent, outStream);
Result res = new SAXResult(fop.getDefaultHandler());
xslTransformer.transform(xmlSource, res);
return outStream.toByteArray()

There appears to be no way to set a custom resolver. Or perhaps someone
has a better idea than to do it via custom URI schemes?

Many thanks for any pointers,


To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

View raw message