xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: Outputting intrinsic dimension info of images
Date Tue, 26 Jul 2011 17:09:26 GMT
you can "preload" the image using the XML Graphics Commons image loading
framework (which FOP uses, too):

The ImageInfo object will then contain the intrinsic size. You can use
the ImageManager from the FopFactory and probably re-use the
ImageSessionContext from the FOUserAgent:
ImageManager imageManager = fopFactory.getImageManager();
ImageSessionContext imageSessionContext = foUserAgent.getImageSessionContext();

This allows you to profit from the image cache.

What you do with the values and where exactly you want to write it in
the PDF is a different question. I don't know what you have in mind here.
Do you want to print the values on the page along with the image? Sounds
like an XSLT extension then.

On 26.07.2011 18:42:15 Erik Wiklander wrote:
> Hi,
> I'm using fo:external-graphic to include images in the pdf. Is there
> any way that I can find out the intrinsic width and height of an image? So
> that I can include that information in the resulting pdf.
> Thanks
> //Erik

Jeremias Maerki

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

View raw message