On 17/06/14 10:46, Dridi Seifeddine wrote:
Hello,
Is that what you were trying to achieve?
No. I want to leave the image as it is and prevent FOP from scaling up or
down. Using this:
<fo:external-graphic src="300dpi.jpg" width="1919px" height="1272px"
content-width="scale-to-fit" content-height="scale-to-fit"/>
If you want the image to appear at its natural size (16.3x10.8cm in the
present case) then you should leave width/height and
content-width/height unspecified:
<fo:external-graphic src="300dpi.jpg"/>
FOP will extract the image’s DPI and calculate its size in mpt
accordingly.
FOP implicitly assumes that the image's DPI is 72, so when calculating
No it doesn’t. It assumes that the px unit you used in the width and
height properties above resolves to 72px per inch. This has nothing to
do with the image’s resolution.
the
mpt size we get (1919000, 1272000), and the image is rendered with no
scaling applied.
I’m not sure I understand what you mean. If you use fo:external-graphic
in the way you show above, FOP effectively scales up the image by around
416% of its natural size.
My question is: Is there any way to override the image's DPI in FOP
using the config?
If you want to override the image’s 300DPI resolution, then you just set
content-width/height to scale-to-fit and width/height to any dimension
you like.
But I suspect that’s not what you’re asking for. If you want to honour
the image’s resoltion of 300DPI, then you should leave width/height and
content-width/height unspecified like explained above.
Thanks
Seifeddine
HTH,
Vincent
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org