In C #. net, how does one generate a PDF file? There are mainly the following ways:

Source: Internet
Author: User
Tags pdflib xsl acrobat distiller
1. Use. Net file stream technology;
If a PDF file is generated using the. NET file stream technology, the syntax of the PDF file must be clear. For example, BT indicates that the object content starts, et indicates that the object content ends, and TD indicates that the line feed. We can download the PDF syntax instructions from Adobe's official website, but the documents have almost 1000 pages. If you are familiar with the syntax before programming, it will take a long time, and the generated PDF document may not meet the requirements. For C # code, see the attachment.
For the syntax of PDF files, see:
Http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf

2. Use third-party controls
I. Open-source controls
(1) 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
③ Invalid Creator 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
⑤ Listen 4net by O2 Solutions
⑥ Pdflib by pdflib GmbH
7. tallpdf. Net by tallcomponents-able to create PDF documents either programmatically using an object model or from XML.
Tutorial: Create and manipulate PDF documents ents-100%. Net by Frank REM (codeproject.com)
Export xmlpdf by visual programming-converts XML to PDF
Considering the cost, using open-source controls is a good choice. In my project, the itextsharp component is used, and the generated PDF file can meet the project requirements. The DLL, source code, and encoding instances related to itextsharp can all be found at http://itextsharp.sourceforge.net.

3. Use Acrobat Distiller
You can directly call the Acrobat Distiller object in the C # or script file (. js or. vbs) to generate a PDF file. However, for copyright consideration, you need to purchase Adobe Acrobat professional.
The code can be found:
Http://dev.yesky.com/msdn/123/2101623.shtml

 

Trackback: http://tb.blog.csdn.net/TrackBack.aspx? Postid = 1400135

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.