Using C # To Create PDF files

Source: Internet
Author: User
Tags ftp site
Preface
Lishui city Automobile Transportation Group Co., Ltd. Information Center min Anting
PDF files are currently popular electronic document formats. They are often used in the development of office automation (OA) and other software. However, there are very few documents about how to create PDF files, the same "brute-force" cracking method is posted on the internet. The code snippets are as follows:
StreamWriter pPDF = new StreamWriter (filePath );
ArrayList xRefs = new ArrayList ();
Float yPos = 0f;
Long streamStart = 0;
Long streamEnd = 0;
Long streamLen = 0;
String strPDFMessage = null;
// PDF document header information
StrPDFMessage = "% PDF-1.1 ";
ConvertToByteAndAddtoStream (strPDFMessage );

XRefs. Add (mPDF. Length );
Str1_message = "1 0 obj ";
ConvertToByteAndAddtoStream (strPDFMessage );
Str1_message = "</Length 2 0 R> ";
ConvertToByteAndAddtoStream (strPDFMessage );
StrPDFMessage = "stream ";
ConvertToByteAndAddtoStream (strPDFMessage );
......
After reading the above production method, I broke three glasses. If the above original method can be used to produce a satisfactory PDF file, it must be a genius. Later, I saw a special PDF file from a website (Web site: http://itextsharp.sourceforge.net/index.html) control of the production of the introduction, dark joy, immediately download the test, it is very easy to make the desired PDF file, because the website is English and has a lot of content, it is very laborious to read. After solving my own problems, I can see that many netizens are still making PDF files and being depressed, therefore, I decided to translate the content into Chinese. Because my English level is average and many places are obscure, the quality of translation is not very satisfactory. Please make an axe, but most of them can understand it. The purpose of this article is to solve the urgent needs of some netizens. The second is to inspire others. If any of you are willing to translate the content of this website accurately, it is a great fortune.
To generate a PDF file using the method described in this article, two controls are required: Prepare. All these resources are stored on my ftp site (ftp: // 202.107.251.26) in the "PDF file creation guide" folder (the other two rar files in the folder are the source code of the two controls for your study), you can download the corresponding resources here, or you can download it directly from the original website.

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.