AddBuiltInFont
IPDFDocument4 :: General document management :: Fonts

See Also Example
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

Reference