In the recently completed project, web printing has become one of our work difficulties. By comparing and combining with the actual situation, we have used to generate a PDF by printing pages first, then print the final solution.
Two methods are used:
1. Use open source code
Itextsharp, Related information http://itextsharp.sourceforge.net/
Create a PDF file for dynamic information. Each line of content must be CodeGeneration, relatively bitter.
2. Use
ABC. PDFTo generate a PDF file for the static page HTML, or convert the aspx file to HTML in the background, and then generate a PDF file. Regardless of the HTML file size
How can I convert a few lines of code into a PDF file?
Note the following two points:
All PDF files are created on the server and must have a set of PDF File naming schemes to ensure that PDF files are not renamed and must be deleted in a timely manner,
Server Load
In this way, the user opens a PDF file in the browser and uses the print of the PDF file to replace ie printing. Without the annoying header and footer, the printing position can be precisely controlled, you can also save the PDF file to your local machine.