We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Convert mhtl to pdf using .net framework blink engine

Hi ,

Reading few articles regarding conversion from mhtl to pdf I was under the impression that you your nuget package for .net framework could convert mhtl to pdf - we did try an mhtl file with an embedded image but could not convert the image when processed.

Do you have an example where you convert an mhtl file with embedded image to pdf using .net Framework?

Many thanks

6 Replies 1 reply marked as answer

SN Santhiya Narayanan Syncfusion Team January 24, 2023 02:21 PM UTC

We checked the reported issue with provided details but it is working properly.We have attached the sample for your reference.Please try the sample on your end and let us know the result whether it is satisfies your requirement or not.

Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/MHTMLToPDF1794420773

If still you are facing any issue ,we request you to share the complete code snippet and product version,input MHTMl file to check this on our end. So, it will be helpful for us to analyze and assist you further on this.

MT Mobile Team January 24, 2023 06:15 PM UTC

Hi thank you for your reply and your sample.

Your sample works , however we have noticed that you are pointing to an endpoint (url) to display the image rather than an embedded image.

we have a situation where we need to display an email where the image is embedded in the document.

I have attached a sample mht with embedded image  to prove the point.

  1. You will see that if you load this file using MS word for example it will display an image at the top left corner correctly.
  2. if you use your sample project the file provided in the zip it  will not be displayed.
This is the problem we are trying to solve .

Can your converter handle embedded image with an mht file?

thanks again for your help

Attachment: samplemhtwithembeddedimage_e127519d.zip

SN Santhiya Narayanan Syncfusion Team January 25, 2023 09:49 AM UTC

We have checked the provided MHTML file in our end. Blink converter internally makes use of chromium executable in headless mode for converting MHTML to PDF. It will preserve the PDF document like how the input MHTML is displayed in chromium-based web browsers (chrome print preview).The same behavior replicates in our converter. So this is not an issue in our converter.

Please refer below screenshot

So, kindly check the image rendering issue in chrome browser and print preview with the mhtml file. 

Please let us know if you need any further assistance in this

Marked as answer

MT Mobile Team January 25, 2023 04:40 PM UTC


thanks for your reply, I see and get your point. However we still need to find a solution to our problem, I understand that your converter does what chrome does...

thanks again

SN Santhiya Narayanan Syncfusion Team January 27, 2023 01:57 PM UTC

The reported issues still need a lot more in-depth research; thus we are looking into them. On January 31st, 2023, further information will be updated.


On further analyzing the provided code snippet, we found that you are referring to some image files in your mhtml file. can you please share those image file with us. so that we can assist with you further in this.

SN Santhiya Narayanan Syncfusion Team January 31, 2023 06:03 PM UTC

We have checked other possibilities by modifying the mhtml file, but the base64 image included in the mhtml file is not being displayed correctly, and it was referred from the content location. So that we could not proceed further on this

Live Chat Icon For mobile
Up arrow icon