HTML to PDF using .net code or 3rd party component

  • Thread starter Thread starter dchadha
  • Start date Start date
D

dchadha

Hi,

I need to convert HTML (online or offline) to PDF in C# application. In
addition I want to merge PDF documents also on the fly. I am looking
for C# / VB.NET code or a .NET component which can be referenced in my
project and accomplish the required tasks.

I have browsed but didn't find a suitable code or component to
accomplish the above task. I will really appreciate any help or pointer
in this.

Thanks
Dinesh
 
We recently did some research into this and found that there are only a
couple of ways to do it without dropping a ton of cash for an on-the-fly
converter:

1) Upload the file into a folder which a component has a "watch" on. When
the file is put there, component sees it and does a "print" to a PDF
conversion "printer" that puts it into a predefined directory
2) Send the "print" command to the "PDF printer" and allow it to place the
PDF where you have it configured

The problem we found with these is that you don't know when the PDF creation
is finished, and there's no way to definitively tell there was an error. Some
printers output error.pdf if it encounters one, but in a multi-user
environment, you don't known if that was your doc or somebody elses.

The solution we found that gave you an API to the PDF interface was over
$1700 and made by ActivePDF. if you have that kind of cash theirs looked like
the most comprehensive. or at least check out the options I outlined above,
also available from them.

There are very cost-effective ways to create a PDF on the fly, but none that
are easy for conversion purposes. I think ActivePDF has a creator that's only
like $30. So if you can take the content of your page and manually write that
to a PDF, you'll have it made pretty cheaply using any of the wide array of
creators that are out there.
 
Thanks a lot for the prompt reply.

Your methodology looks great. As my application is a desktop
application. Only single user will be using the application, so your
strategy should work fine. I have used cutepdf writer (printer) and I
think it will work here also.

But I am not sure how I am going to save HTML first locally with images
etc. for print. What I require is a pdf conversion of any html page. In
this case I think I have to always first download and save that html
page locally to the desktop and in this process I might loose the
format, images etc. of HTML.

What I was looking for is a way by which I will assign the URL and it
should be converted to pdf.

Do you think that the above can be done ?

Thanks
Dinesh
DeltaX Solutions
http://www.deltaxsolutions.com
 
Back
Top