-
1. Re: how to insert png to pdf?
lrosenth May 21, 2012 3:46 AM (in response to cheng845)You need to decode the PNG format to get just the raw pixels. Then separate the alpha pixels from the rest and write both objects.
Also, DCTDecode is fro JPEG. You'd probably want FlateDecode for PNG.
-
2. Re: how to insert png to pdf?
cheng_x May 21, 2012 4:13 AM (in response to lrosenth)I have get the alpha piexels and raw pixel(RGB) using the libpng to decode png format, but i don't know that what's the content of
31 0 obj stream.I use the adobe acrobat to insert a png to pdf.the result:
24 0 obj
<</Contents 43 0 R/CropBox[0.0 0.0 612.0 792.0]/Group 39 0 R/ID 40 0 R/MediaBox[0.0 0.0 612.0 792.0]/PZ 1.0/Parent 14 0 R/Resources<</ColorSpace<</CS0 33 0 R>>/Font<</C0_0 38 0 R>>/ProcSet[/PDF/Text/ImageC]/XObject<</Im0 44 0 R>>>>/Rotate 0/Type/Page>>
44 0 obj
<</BitsPerComponent 8/ColorSpace/DeviceRGB/Filter/DCTDecode/Height 154/Length 8792/Name/X/SMask 45 0 R/Subtype/Image/Type/XObject/Width 154>>stream
............
endstream
45 0 obj
<</BitsPerComponent 8/ColorSpace/DeviceGray/Filter/FlateDecode/Height 154/Length 6157/Name/X/Subtype/Image/Type/XObject/Width 154>>stream....
endstream
I know that the stream data of 45 0 obj is alpha data after compressed,but i don't know what's format the stream data of 44 0 obj and how to get it from a png.
-
3. Re: how to insert png to pdf?
amit12121989 Nov 21, 2013 2:17 AM (in response to cheng_x)What are the values of image matrix for png image file ?
imageMatrix.a = ASInt16ToFixed(width);
imageMatrix.d = ASInt16ToFixed(height);
imageMatrix.b = imageMatrix.c = fixedZero;
imageMatrix.h = fixedZero;
imageMatrix.v = fixedZero;
Is it correct for png ?


