You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by fop user <fo...@supermachien.kotnet.org> on 2002/04/25 15:09:38 UTC

[urgent] images in pdf via fop - incorrect size

Hi there,

for my thesis I am working with Cocoon and FOP to produce a PDF of the
text. I finally managed to incorporate images (fo:external-graphic) in the
PDF quite a big problem with this.

All the images are stretched out so their width is equal to the width of
the page. I have tried a lot to work around this problem, but without
result.
List of things I tried:
- set the width and height attributes
  - values in px, pt, mm, cm
==> images where still stretched out

- embed the image in a table and set the width of the column to the width
of the image
==> incorrect pdf produced

I am currently using FOP0.20.3, but I have tried a number of different
versions of FOP, including 0.17, 0.20.1, 0.20.2, ...

How can I solve this problem? It is urgent, since my thesis is due in less
than 3 weeks and I do not have the time to manipulate the images so
everything looks fine.

Tnx in advance


Re: [urgent] images in pdf via fop - incorrect size

Posted by fop user <fo...@supermachien.kotnet.org>.
On Mon, 29 Apr 2002, J.Pietschmann wrote:

> fop user wrote:
> > All the images are stretched out so their width is equal to the width of
> > the page.
>
> Unless forcibly scaled down, bitmap images are rendered at
> 1/72 inch per pixel in the PDF, or roughly 3.53 cm per
> 100 pixel. Are your images of a high resolution?
>

This was indeed the problem. This hint solved the problem, tnx.



Re: [urgent] images in pdf via fop - incorrect size

Posted by "J.Pietschmann" <j3...@yahoo.de>.
fop user wrote:
> All the images are stretched out so their width is equal to the width of
> the page.

Unless forcibly scaled down, bitmap images are rendered at
1/72 inch per pixel in the PDF, or roughly 3.53 cm per
100 pixel. Are your images of a high resolution?


> List of things I tried:
> - set the width and height attributes

Setting either widht or heigth or both on the
fo:external-graphic works for me. If only one is set,
the aspect ratio is conserved.


> - embed the image in a table and set the width of the column to the width
> of the image
> ==> incorrect pdf produced

This works for me too.

Can you provide a trimmed down sample of your code and an
image, preferably a well compressed GIF or JPG, which
demonstrates the problem?

J.Pietschmann