convert html file to pdf with vb.net

G

Guest

hi,
i want to convert exisiting html files to pdf files with vb.net. the covert
process should run in the background, the user should not see anything from
it.

is there a freeware component which has implemented this functionality, or
is there a way to develop it with .net?

Thank's for any productive comments...
Regarsds Jens
 
J

Jonathan Boivin

You could install the free printer CutePDF which will allow you to "print"
the HTML file into a PDF file.
 
O

\(O\)enone

kikde said:
i want to convert exisiting html files to pdf files with vb.net. the
covert process should run in the background, the user should not see
anything from it.

is there a freeware component which has implemented this
functionality, or is there a way to develop it with .net?

We spent some time addressing this problem a while back.

The first problem is that you need something to render the HTML. You really
have two options here: use an existing browser engine (such as Internet
Explorer) or use a custom HTML renderer implementation. If the solution you
use applies the latter option, you're always going to be limited in the
functionality which it is able to offer -- goodness knows it's taken long
enough to IE and Firefox to reach a point where they are acceptably
standards-compliant.

We found a number of packages that could potentially do the job, some free
and some very expensive. The solution we settled on is as follows:

1. Install PDFCreator (http://sourceforge.net/projects/pdfcreator/). This
installs a virtual printer driver, which stores all documents sent to it as
..pdf files on disk. Yes, this is pretty ugly and fragmented as a solution,
but this is the tidiest of the virtual printer packages we managed to find;
all the GhostScript and RedMon libraries are installed automatically and
hidden away inside the PDFCreator implementation so you don't need to
install or configure them separately.

2. Configure it to use the AutoPrint functionality, telling it where you
want it to put the output files.

3. In your application, host a WebBrowser control on one of your forms.

When you want to print some HTML, put it into the WebBrowser and tell it to
print to the virtual printer.

With this approach we've managed to put together a reliable and stable
HTML-to-PDF service, but it's still far from being as neat and tidy as I
like my solutions to be. If anyone knows of a cleaner way to achieve this
I'd love to hear about it.

(O)enone
 
G

Guest

Thank you very much for this detailled answer.
I will try to develop a stabil solution...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Convert HTML to PDF FIle 5
can we convert .doc and .txt files to pdf? 5
Convert Word doc to PDF using VB.NET 2
Code to Extract Text from PDF 3
pdf to html 5
C# to VB.Net 4
Print PDF File 3
vbs to vb.net 13

Top