ASP.NET - How to convert the html in specific div tag into pdf format....

Asked By Divya Maheswari on 25-Jun-13 08:59 AM
Can someone suggest some options?
Robbe Morris replied to Divya Maheswari on 25-Jun-13 08:58 AM
You'll have to create a web service and send the html to it.  From server side code, you can use something Aspose to convert the HTML to PDF.  Short of creating an ActiveX control that you users would need to install in the browser, there is no way to convert HTML to PDF client side in the browser.

You'll want to hard code the styles into your html and avoid CSS.  A lot of these 3rd party PDF controls claim they can handle css but most don't do it particular well.  The PDF control Essential Objects does this better than Aspose (I tested both against css with inheritance all over the place) but they don't offer a class to send PDFs to a printer from server side code.  Aspose does.

You might find an open source PDF converter but a lot of these use Adobe Acrobat installed on the server and simply execute command line requests to convert the html to PDF.  I'd advise against this.  Lots of reports of this sort of thing breaking with Adobe releases and update for Acrobat.
Harish Mady replied to Divya Maheswari on 26-Jun-13 03:04 AM
see this it can help you
Stella Joseph replied to Harish Mady on 27-May-15 05:35 AM
There are various converter available. I have used and hope It can help you also.