Replace PNGs to EMFs

I have a PDF generated through another program that has images sourced by PNG files.


I want to replace all the images with their EMF equivalents. I have both the original PNG files and the replacement EMF files on my drive.

What’s the best way to go about doing this?

-Jeff

Hi Brian,

Aspose.Pdf.Kit allows you to replace an image, at a specified index, with a new one using ReplaceImage method. Please try it at your end and see if it works for you. However, if it doesn’t satisfy your requirement then please share with us and we’ll further look into your requirement.

If you have any further questions, please do let us know.
Regards,

Shahzad,


Is there a way to cycle through the existing images so I can look at their properties and know which ones to replace?

-Jeff

Hi Brian,

Can you please elaborate your requirement a little bit? Do you want to get a list of the existing images from a PDF file? Are you interested in the type (JPG, BMP etc) of the image? Or, you would like to find their order in the PDF fille?

Please help us understand your requirement, so we would be able to help you out.
Regards,

Shahzad,

I want to convert an html page to PDF. Due to the current limitations of Aspose (no css, etc) I had to use a separate program to do this.

I also need to make it so the user can zoom without pixilization. This requires replacing all flat images in the PDF with vectorized versions of themselves. The other product doesn't have the ability to do this, but I'm hoping Apose does.

I'm hoping to be able to take the document, cycle through all the images, and replace references to the old png files with the EMF versions of themselves.

You told me how to replace an image if I knew its location.

I still need to know how to cycle through images, get some sort of readable object, and get enough information to determine what the image is so I know it can be replaced. Useful information could be the height and width, an image file, etc. Even if the image isn't the same as the original, I can at least use image comparison software to see if it's similar enough to make a reasonable assumption as to what EMF to replace it with. Unfortunately, with no way to cycle through the images or get any data on them whatsoever, I can not do this.

Thank you,
Jeffrey

Hi Jeffrey,

Thank you very much for sharing the details.

I’m afraid, this requirement is currently not supported in Aspose.Pdf.Kit. However, I have logged it as PDFKITNET-14865 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is supported.

We’re sorry for the inconvenience.
Regards,

The issues you have found earlier (filed as 14865) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.