Andreas Lehmkühler wrote: > Pepijn Schmitz schrieb: >> The question is: how can I find out from a PDF at which aspect ratio to >> display an embedded fax-originated TIFF? > Pictures are saved in their original format. The scaling is done by > the pdf. If you insert a graphic as PDXObject to a page you have to > mention the starting coordinates and the scaling of both axes relative > to their original size. > This means that you have to extract the picture and you have to get > the scalingfacros from the corresponding XObject. Thanks for the info! I have some more questions now:
How do I get the scaling factors for the image? The image in question is contained in a PDXObjectImage object, and that class has a width and a height property, is that what you are referring to? Unfortunately the Javadoc fails to mention in what units the width and height are specified, do you happen to know the units of these properties? Kind regards, Pepijn Schmitz > > > Andreas > > >> >> Cheers, >> Pepijn >> >> Pepijn Schmitz wrote: >>> Hi everyone, >>> I'm using PDFBox to receive faxes. Our fax service provider receives >>> them and emails them to us as PDF attachments. I'm reading the emails, >>> extracting the PDF attachments and then using PDFBox to extract the >>> TIFF >>> images from the PDF's. >>> This works great (after I found out I had to install the JAI ImageIO >>> Tools), but there is one problem: for some faxes the TIFF's are only >>> half-height. The whole page is there, but is is squashed in the >>> vertical >>> direction. I imagine that these are faxes which were sent at some kind >>> of "coarse" setting. >>> >>> The thing is, if I open these PDF's in Adobe Reader they are displayed >>> with the correct aspect ratio. So somewhere in the PDF there must be >>> information telling Adobe Reader to scale the image up in the vertical >>> direction, but I don't know how to get at this information. >>> >>> Can someone here help me with this problem? Do you know how this >>> information is stored in the PDF, and how I could get at it with >>> PDFBox? >>> Is it stored in the TIFF itself somehow? I could email interested >>> parties one of the PDF's if it would help. >>> >>> Kind regards, Pepijn Schmitz >>> > >
