1. Use. NET file stream technology;
If passed. NET file stream technology to generate PDF files, it must be clear that the syntax of the PDF file, such as BT indicates the beginning of the entity content, et indicates the end of the entity content, TD means line wrapping and so on. We can download the PDF syntax documentation from Adobe's official website, but there are almost 1000 pages in the document. If you are familiar with good grammar and then re-program, it will take a long time, and the resulting PDF document does not necessarily meet the requirements. See the attachment for C # code.
The syntax for PDF files is described in:
Http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf
2. Using third-party controls
I. Open Source Control
①asp.net FO pdf at sourceforge.net-generates Xsl-fo from DataTable to render PDF
②itextsharp at SourceForge.net
1.Examples and tutorial:http://itextsharp.sourceforge.net/
2.Also See this article:create PDF on the fly with. NET and Itextsharp by Valerio Fornito, dopostback.com
③pdfcreator at Gotdotnet-design PDF document visually using Visual Studio IDE
④report.net at SourceForge.net
II. Commercial controls
①abcpdf. NET by Websupergoo-free license also available
②apoc Xsl-fo by Chive software-generates PDF using XSL-FO
③aspose.pdf by Aspose
④dynamicpdf by Cete Software
⑤pdf4net by O2 Solutions
⑥pdflib by Pdflib GmbH
⑦tallpdf.net by tallcomponents-able to create PDF documents either programmatically using a object model or from XML.
Tutorial:create and manipulate PDF documents-100%. NET by Frank Rem (codeproject.com)
⑧xmlpdf by Visual Programming-converts XML to PDF
Using open source controls is a good choice from a cost factor. In my project, the Itextsharp component was used, and the resulting PDF file was able to meet the project requirements. DLLs, source code, and encoding instances for ITEXTSHARP are available from http://itextsharp.sourceforge.net/.
3. Using Acrobat Distiller
The Acrobat Distiller object can be called directly in C # or in a script file (. js or. vbs) to generate a PDF file. However, from copyright considerations, you will need to purchase Adobe Acrobat Professional.
The code can refer to the following URLs:
Http://dev.yesky.com/msdn/123/2101623.shtml
In C #. NET, how to generate PDF files? There are several main ways