First, set a reference in your project to the 3 DLL's that Pdfizer uses. Here are the 3 dll names to set a reference to:
- ICSharpCode.SharpZipLib.dll (This component is used to parse the HTML)
- itextsharp.dll (This component is used by Pdfizer to create the PDF document)
- Pdfizer.dll (This is the main component with the HtmlToPdf object that executes the conversion operations).
You can download them here.
In my example I use Generic Handler to send content to client side. Following step by step you can create a simple web app to download pdf report
1. Create new Web project and use three library above as references.
2. Create new page (don't use master page) name ExportPDF.aspx.
3. Add this code to ExportPDF.aspx page.
4. Create service to generate pdf file using ashx type.
- Create content of report in HTML type.
- Convert content to pdf type
- Push data to client
Pdfize can help use create pdf from http link.
No comments:
Post a Comment