Hi Seifeddine,

On 16/06/14 16:01, Dridi Seifeddine wrote:
Hello,



I see a strange issue when I render a 300 dpi image in PDF. The image is
always scaled down.



I understand that FOP uses mpt for its internal calculations, and the
formula for pixels to mpt conversion depends on the horizontal/vertical dpi
specified in the image (valueMpt = valuePx * 1000 * 72 / dpi). Thus, the
higher the dpi value, the lower the image size in mpt unit.



When I specify the image's width and height, and set attributes
content-width="scale-to-fit" content-height="scale-to-fit", FOP does no
scaling.

The image looks fine in the PDF file you attached. Having left
width/height and content-width/height unspecified, the image is left to
its default size which is approximately 16.3x10.8cm.

If you want to scale the image up so that it fills the width of the
page, then you have to set content-width to scale-to-fit /and/ width to,
e.g., 100%:
    <fo:external-graphic src="300dpi.jpg"
      content-width="scale-to-fit" width="100%"/>

If you leave width unspecified then the image will remain at its default
size.

Is that what you were trying to achieve?




Thanks



Seifeddine

HTH,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to