Components for Developers
© 2000-2008, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Fonts
Collapse All

This method adds one of 14 built-in fonts using the font style specified. It returns a font identifier.

Syntax

LONG AddBuiltInFont (
BuiltInFont font,
VARIANT_BOOL underline,
VARIANT_BOOL strikeout
)
Parameters
font
One of 14 built-in fonts

underline
VARIANT_TRUE turns on the font's underline property.

strikeout
VARIANT_TRUE turns on the font's strikeout property.

Return value
Identifier of the font which will be used in the UseFont method.

Example

Adding a Built-In Font

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
fnt1 := PDF.AddBuiltInFont(bfHelveticaOblique, false, false);
fnt2 := PDF.AddBuiltInFont(bfCourierBold, false, false);
PDF.UseFont(fnt1, 14);
PDF.ShowTextAt(20, 20, 'Helvetica oblique.');
PDF.UseFont(fnt2, 14);
PDF.ShowTextAt(20, 40, 'Courier bold.');
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long fnt1 = PDF->AddBuiltInFont(BuiltInFont.bfHelveticaOblique, false, false);
long fnt2 = PDF->AddBuiltInFont(BuiltInFont.bfCourierBold, false, false);
PDF->UseFont(fnt1, 14);
PDF->ShowTextAt(20, 20, "Helvetica oblique.");
PDF->UseFont(fnt2, 14);
PDF->ShowTextAt(20, 40, "Courier bold.");
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long fnt1 = PDF.AddBuiltInFont(BuiltInFont.bfHelveticaOblique, false, false);
long fnt2 = PDF.AddBuiltInFont(BuiltInFont.bfCourierBold, false, false);
PDF.UseFont(fnt1, 14);
PDF.ShowTextAt(20, 20, "Helvetica oblique.");
PDF.UseFont(fnt2, 14);
PDF.ShowTextAt(20, 40, "Courier bold.");
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
fnt1 = PDF.AddBuiltInFont(9, false, false) 'BuiltInFont.bfHelveticaOblique
fnt2 = PDF.AddBuiltInFont(6, false, false) 'BuiltInFont.bfCourierBold
PDF.UseFont fnt1, 14
PDF.ShowTextAt 20, 20, "Helvetica oblique."
PDF.UseFont fnt2, 14
PDF.ShowTextAt 20, 40, "Courier bold."
PDF.SaveToFile "test.pdf", true

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2008, Two Pilots