Distorted image in generated PDF when AddImage function is passed image with "png" format

Hi

I used AddImage method to add an image in the existing PDF. The image is in “png” format (which is one of the format supported by AddImage method). But in the resulting PDF the image is so distorted to recognize.

Please provide solution as we already have initiated the process to purchase the tool.

Please provide codes and attach the PNG image file here which can help us to reproduce the same error on our end.

We will investigate it and respond you soon.

Hi

Actually we had Visio images in word document which we needed to extract from word document and put in PDF. The images were extracted from word document using Aspose.Words were in "wmf" format. When I tried to convert "wmf" images to "jpg" or "gif" to put in PDF the background of the converted image was black (which hided major portion of image). To resolve the issue I converted the "wmf" images to "png" format as "png" was one of the accepted format for AddImage method. Image converted to "png" from "wmf" was high quality. But when I passed these "png" image to Aspose.Pdf.Kit's AddImage method the resuting image in PDF was very distorted.

My main intention was to get good quality images in "gif" or "jpg" format to pass to AddImage method. Which I acheived using a simple technique. I used Aspose.Words's Save method. And Saved the word document containing Visio Images in HTML format which has given me all the images in "gif" format. The quality of the images are nice. Now I have paased these "gif" images to AddImage method and get the PDF generated successfully.

One comment: I was disappointed to not see Aspose.Visio tool. It will be great if Aspose will build this tool.

Anyway Thanks for your Response.


Dear Wajihuddin,

Glad to see have solved the problem.
Your advices are helpful for us.

Thanks & Best regards!