Re: gray bitmap destroyed as importpage manipulates data?

"ybosso73" <[email protected]> Sat, 24 Nov 2007 12:26:58 -0000
Newsgroups gmane.comp.lang.perl.modules.pdfapi2
Message-ID <[email protected]>
Hello there!

In the meantime I've played around with some data, and it seems, that
the source of the erratic behaviour is some misaligned data in the
images's meta-info.

In the PDF-file the image is enveloped with resolution of 381 dpi,
loaded in Photoshop it shrinks downto 380 dpi. Resaved from Photoshop,
the very same image transferred to PDF processing by API2 results in
error-free new PDFs...

Thus, I conclude: "importpage" gives away control to
"importPageIntoForm". The latter function "in-filters" the
PDF-embedded image.
Fed with a wrong dpi-value, this function seems to be the one to mix
up my image!

There may be a solution, if the meta-data dpi-value was ignored and
recalculated on the basis of the real image...
Is there any way, to keep API2 from touching/changing the embedded
PDF, be it images, fonts or text? Can't it should just import it and
keep hands off? 8-))

By the way: I also played around with the compression feature, as I
was suspiciuos, about it being the source of evil. I could not prevent
API2 to compress embedded images. $pdf->{forcecompresssion}=0 didn't
do it, nor delete $page->gfx->{Filter}. API2 took an uncompressed
embedded-RGB TIF and ZIP-compressed it.
But, if the image was encoded other than ASCII, e.g. ASCII-hex or
alike, the resulting image was not compressed. Did I miss a clue?

Any comment on this matter is appreciated.