473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

convert html file to pdf with vb.net

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
May 15 '07 #1
3 9573
You could install the free printer CutePDF which will allow you to "print"
the HTML file into a PDF file.

--

Thanks,
Jonathan Boivin
---
jo************@cints.net | http://www.cints.net
"kikde" <ki***@discussions.microsoft.coma écrit dans le message de news:
9D**********************************@microsoft.com...
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

May 15 '07 #2
kikde wrote:
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
May 15 '07 #3
Thank you very much for this detailled answer.
I will try to develop a stabil solution...

"(O)enone" wrote:
kikde wrote:
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
May 16 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Closer | last post by:
I am new to XML and XSL, could someone please help? I have my XML and XSL files and can view the XML file with the stylesheet in my browser. Everything is fine. What I want to do is to...
1
by: Matt | last post by:
I want to use XML to store a document's configurations. And I can convert to different file format by using XSL. For example, convert to HTML, PDF, or RTF. But the contents are all stored in single...
3
by: hunterb | last post by:
I have a file which has no BOM and contains mostly single byte chars. There are numerous double byte chars (Japanese) which appear throughout. I need to take the resulting Unicode and store it in a...
13
by: kbperry | last post by:
Hi all, Background: I need some help. I am trying to streamline a process for one of our technical writers. He is using Perforce (version control system), and is constantly changing his word...
5
by: melickas | last post by:
We designed a custom application using Office Developer Tools '97 which included a Run-time version of Access--- so it would not matter if our customer even had any version of Access on their...
6
by: PenguinPig | last post by:
Dear All Experts I would like to know how to convert a HTML into Image using C#. Or allow me contains HTML code (parsed) in Image? I also tried this way but it just display the character "<" &...
4
by: csgraham74 | last post by:
Hi, Ive posted on this previously but had no response. Basically i need to build some html using a rich text editor. Then i want to actually create an html document from this and save it to my...
2
by: suji | last post by:
Hai, Are there any 3rd party controls who provide free libraries to convert my html form to pdf in c#? I need to have a button on my form, that should convert my page to pdf format. Can any one...
5
by: Damiano | last post by:
Hello, How could i convert Html page in a PDF file? Is there a free library? Thanks
2
budigila
by: budigila | last post by:
Hiya peeps, Okies, I have been trying to work this out for a while now to no avail... I am a beginner to this whole coding thing but have made great strides in my project. Basically what I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.