Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Adding an image to a pdf results a in blurry / not readable document

$
0
0
Goal: we start from a pdf containing a nontransparent tiff (white background) and we want to obtain the same pdf containing the same image made transparent.

Procedure: extract the tiff, read it, make transparent, save it in a format that supports background transparency (tiff or png), remove the original image from the pdf, add the new transparent image to the pdf. Please note that the new transparent image has the exact same resolution as the old one.

Problem: while the transparent image looks exactly like the original one, once added to the pdf it looks blurry as if interpolation had been added.

What we would expect: to obtain a resultinf pdf with no blur, like the original one.

Note: readding the original image results in a clear pdf, adding the transparent image in a blurry pdf.

The files for this case can be download from here:
http://www.mechworks.com/ftproot/outgoing/giorgio/aspose_pdf_add_image.zip

Files included in the zip:
tmpimg_0.tif  the tiff exctracted fron inside the pdf
tmpimgtransp_0.tif  a transparent tiff that looks good, but that, if re-added to the pdf results in a blurry image
tmpimgtransp_0.png   same as above, but in png format
a0.tif.pdf  the original pdf
pdf original.png  what the original pdf looks like at 100% zoom
pdf readded with transparency.png  what the pdf wuith transparent image looks like at 100% zoom (blurry)

To add the image we use the command
pdfDocument.Pages[pdfPage].AddImage(tmpTransparentTifPath, pdfDocument.Pages[pdfPage].GetPageRect(false));

We are using Aspose.Pdf. version 8.0.0.0 on .NET 3.0 in C# with VS2010

Viewing all articles
Browse latest Browse all 3131

Trending Articles