HTML to PDF Image problems?

Dear All,


Has anyone had problems with the PDF not generating when you add images tags to your HTML?

Most computers are fine (including ours) but we have a client that is having problems with our .net application generating PDFs. When we removed the image tags in the HTML ( <img…) it generates the PDF fine. It seems images are the problem. What it does is it seems to create a PDF icon on the screen but completes the process straight away and the PDF has a file size 0KB. Opening up the PDF in notepad reveals nothing which means the PDF is blank (it has not been generated).

Could there be something conflicting with Images on their pc (anti-virus or something)?
Has anyone else experienced this problem?

Is there a workaround?

(What we are thinking is generating the PDF with just text from the HTML and then if possible load the PDF in again, find a tag and replace it with an image from a stream (if this is possible) and generating the PDF that way. This may or may not work but it is just an opinion / possible workaround)

Kind Regards,
Will

Hi Will,


Thanks for your inquiry. Please check Aspose.Pdf declaration about full trust permission. Usually your reported issue arises in web applications due to right issues.

Moreover, We will appreciate it if you please test following image from Aspose web server and share the results?



We are sorry for the inconvenience caused.

Best Regards,

William1991:
(What we are thinking is generating the PDF with just text from the HTML and then if possible load the PDF in again, find a tag and replace it with an image from a stream (if this is possible) and generating the PDF that way. This may or may not work but it is just an opinion / possible workaround)
Hi Will,

Thanks for using our API’s.

Adding more to Tilal’s comments, if you need to go with above stated approach, then you may consider Text Search and add image feature of Aspose.Pdf for .NET.

First you need to find particular text inside PDF document, get coordinates of TextFragment, replace the text with blank characters and then add image over same coordinates. For further details, please visit