{oapdf_gg}
Office software is closely linked to the PDF,the PDF is also must have to control!      Set home Page  Add to Favorites  
You are here:Home > PDF Application > PDF Development
PDF Development
Using C# language the whole PDF document Strategy Guide Graphic
Finishing by: Date:2009-04-17 20:59:48 Popularity: Tags:

 

the first part of iText simple application

Chapter to create a Document

five

use iText to create a PDF document:helloword.

a first step, create a iTextSharp.text.Document object instance:

Document document = new Document ();

the second step, creating a Writer for the Document example:

PdfWriter.getInstance (document, new FileStream ( "Chap0101.pdf", FileMode.Create ));

The third step is to open the current Document

document.Open ();

fourth step, for the current content of Document added:

document.Add (new Paragraph ( "Hello World "));

the fifth step, close the Document

document.Close ();

complete sample code, see code 0101.

in the case, it is not difficult to see that the production of a PDF document is very simple.

Note:If you were in "document.Add (new Paragraph (" Hello World "));" the string "Hello Word" into Chinese, such as "This is my first PDF file", the result must let you disappointed, as PDF documents generated by the Chinese did not show up, do not worry, in Chapter 9 should be devoted to the issue of fonts, Chinese show will be solved, if not correctly display the Chinese, it there is no need for translation of this article.

the following steps to do this in detail.

there isArticle InformationsComment Information
Category column

Site Help | Site Map | Feedback |
OAPDF.COM Copyright 2009 V1.1