Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
PDF Creator Pilot 3 Knowledge Base
How to Write Text in a PDF Document

See Also
Collapse All

With the following steps, you can see how to easily manipulate text using PDF Creator Pilot 3.

1. Choose a color using the PDFPAGE_SetGray method, for example. Also, choose a line width for the new text using using PDFPAGE_SetLineWidth. You can also set character spacing and word spacing and text rendering mode.

Delphi :

PDF.PDFPAGE_SetGray(0);
PDF.PDFPAGE_SetLineWidth(1);
PDF.PDFPAGE_SetCharacterSpacing(0.5);
PDF.PDFPAGE_SetWordSpacing(-0.6);

Visual Basic or Visual Basic Script :

PDF.PDFPAGE_SetGray 0 
PDF.PDFPAGE_SetLineWidth 1 
PDF.PDFPAGE_SetCharacterSpacing 0.5 
PDF.PDFPAGE_SetWordSpacing -0.6 

C/C++ :

PDF->PDFPAGE_SetGray(0);
PDF->PDFPAGE_SetLineWidth(1);
PDF->PDFPAGE_SetCharacterSpacing(0.5f);
PDF->PDFPAGE_SetWordSpacing(-0.6f);

C# :

PDF.PDFPAGE_SetGray(0);
PDF.PDFPAGE_SetLineWidth(1);
PDF.PDFPAGE_SetCharacterSpacing(0.5f);
PDF.PDFPAGE_SetWordSpacing(-0.6f);

2. Select a font and set the name, style, weight, and character set for the new text string.

The sample below creates text with a Verdana font, size 14, using the Russian character set, italic style. See PDFPAGE_SetActiveFont for a full description.

Delphi :

PDF.PDFPAGE_SetActiveFont('Verdana', false, true, false, false, 14, charsetRUSSIAN_CHARSET);

Visual Basic or Visual Basic Script :

PDF.PDFPAGE_SetActiveFont "Verdana", False, True, False, False, 14, 204 

C/C++ :

PDF->PDFPAGE_SetActiveFont("Verdana", FALSE, TRUE, FALSE, FALSE, 14, charsetRUSSIAN_CHARSET);

C# :

PDF.PDFPAGE_SetActiveFont("Verdana", false, true, false, false, 14, TxFontCharset.charsetRUSSIAN_CHARSET);

3. Place your text string at specific coordinates or all wrapped in a box.

Delphi :

PDF.PDFPAGE_TextOut(10, 40, 15, 'Simple test');
PDF.PDFPAGE_TextBox(120,40,180,60,'Text in box', 1, 1);
PDF.PDFPAGE_TextOutBox(120, 80,10, 60,50,'Bounced text');

Visual Basic or Visual Basic Script :

PDF.PDFPAGE_TextOut 10, 40, 15, "Simple test" 
PDF.PDFPAGE_TextBox 120,40,180,60,"Text in box", 1, 1 
PDF.PDFPAGE_TextOutBox 120, 80,10, 60,50,"Bounced text" 

C/C++ :

PDF->PDFPAGE_TextOut(10, 40, 15, "Simple test");
PDF->PDFPAGE_TextBox(120,40,180,60,"Text in box", hjCenter, vjCenter);
PDF->PDFPAGE_TextOutBox(120, 80,10, 60,50,"Bounced text");

C# :

PDF.PDFPAGE_TextOut(10, 40, 15, "Simple test");
PDF.PDFPAGE_TextBox(120,40,180,60,"Text in box", TxHorJust.hjCenter, TxVertJust.vjCenter);
PDF.PDFPAGE_TextOutBox(120, 80,10, 60,50,"Bounced text");

See descriptions: PDFPAGE_TextOut, PDFPAGE_TextBox, PDFPAGE_TextOutBox.

See Also

Reference

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots