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.
Common
Collapse All

This property gets or sets the height of the current page.

Syntax

FLOAT PageHeight { get; set; }
Value
The height (in pixels) of the current page

Remarks

All changes to a page must occur before the first drawing on a page.

Example

How to Draw Centered Text

Delphi
[copy to clipboard]
// PDF object is supposed to be created
str := 'Centered text.';
fnt := PDF.AddBuiltInFont(bfTimesRoman, false, false);
PDF.UseFont(fnt, 40);
w := PDF.GetUnicodeTextWidth(str);
h := PDF.GetUnicodeTextHeight(str);
PDF.ShowTextAt((PDF.PageWidth - w) / 2, (PDF.PageHeight - h) / 2, str);
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
wstring str = L"Centered text.";
long fnt = PDF->AddBuiltInFont(bfTimesRoman, false, false);
PDF->UseFont(fnt, 40);
float w = PDF->GetUnicodeTextWidth(str);
float h = PDF->GetUnicodeTextHeight(str);
PDF->ShowTextAt((PDF->PageWidth - w) / 2, (PDF->PageHeight - h) / 2, str);
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
string str = "Centered text.";
long fnt = PDF.AddBuiltInFont(BuiltInFont.bfTimesRoman, false, false);
PDF.UseFont(fnt, 40);
float w = PDF.GetUnicodeTextWidth(str);
float h = PDF.GetUnicodeTextHeight(str);
PDF.ShowTextAt((PDF.PageWidth - w) / 2, (PDF.PageHeight - h) / 2, str);
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
str = "Centered text."
fnt = PDF.AddBuiltInFont(0, false, false) 'BuiltInFont.bfTimesRoman = 0
PDF.UseFont fnt, 40
w = PDF.GetUnicodeTextWidth(str)
h = PDF.GetUnicodeTextHeight(str)
PDF.ShowTextAt (PDF.PageWidth - w) / 2, (PDF.PageHeight - h) / 2, str
PDF.SaveToFile "test.pdf", true

See Also

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