{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 step to create a Document instance:

iTextSharp.text.Document-object constructor three:

public Document ();

public Document (Rectangle pageSize);

public Document (Rectangle pageSize,

int marginLeft,

int marginRight,

int marginTop,

int marginBottom);

the first A4 page constructor as a parameter to call the second constructor, the second constructor to 36 pounds on each side Margins for the third parameter constructor call

Size

u page:

you can specify the color and size to create your own page, sample code, 0102 to create a thin light yellow background of the page:

Rectangle pageSize = new Rectangle (144, 720);

pageSize.BackgroundColor = new Color (0xFF, 0xFF, 0xDE);

Document document = new Document (pageSize);

Typically, you do not have to create such a page, and page size can choose the following:

A0-A10, LEGAL, LETTER, HALFLETTER, _11x17, LEDGER, NOTE, B0-B5, ARCH_A-ARCH_E, FLSA and FLSE

most cases the use of vertical page, if you want to use the horizontal page, you only need to use the rotate () function:

Document document = new Document (PageSize.A4.rotate ());

detailed sample code, see code 0103.

u Margins:

when creating a document, you can define the upper and lower, left and right margins:

Document document = new Document (PageSize.A5, 36, 72, 108, 180);

in 0104 in the sample code you can see the document there is a 0.5 inches from the left side and 1 inch from the right side, on the margins of 1.5 inches to 2.5 inches under the margins.

Description:

when you create a rectangle, or set up margins, you may want to know what the unit of measure:cm, inch, or pixel, in fact, the default layout of the measurement system based on units of pounds of other units derived approximation, such as 1 inch = 72 pounds, if you want the PDF pages in A4 to create a rectangle, you need to calculate the following data:

21 cm/2.54 = 8.2677 inches

8.2677 inch 72 = 595 lbs

29.7 cm/2.54 = 11.6929 inches

11.6929 inch 72 = 842 lbs

the default margins for the half-inch or 36 pounds.

If you modify the page size, only affect the next page, if you modify the page margins, it affects all, it is used with caution.

initial value on the page, please refer to the third step.

there isArticle InformationsComment Information
Category column

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