Click here to Skip to main content
15,039,319 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am looking for a way of Converting MHTML file to PDF type . Is there any way to do this using .Net coding?



yes, there is. You have to pay for a library to do it, though. There's no PDF functionality in .NET. HTML creates another issue. HTML rendered by what browser, given that they are not all the same ? To what dimensions ? But, I'm sure that at a minimum, you can write code to turn HTML in to a bitmap through a web browser control, and I know you can buy libraries to turn images in to PDFs.
You may have a look at CodeProject's articles about PDF manipulation[^].
However, if your HTML document is very simple then you may try to develop yourself the conversion algorithm: you have to parse the HTML and then create the PDF file according to PDF specifications ( see here[^] (it is not impossible, someone did it for the reverse task, see the "Code to extract plain text from a PDF file"[^] article).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900