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

Adds a system font using font face, font style and character set specified and return a font identifier.

Syntax

LONG AddFont (
BSTR fontFace,
VARIANT_BOOL bold,
VARIANT_BOOL italic,
VARIANT_BOOL underline,
VARIANT_BOOL strikeout,
FontCharset charset
)
Parameters
fontFace
System font face name.

bold
Is the font bold.

italic
Is the font italic.

underline
Is the font underlined.

strikeout
Is the font strikeout.

charset
Font character set.

Return value
Added font identifier to be used in UseFont method.

Example

Adding system font

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
charSet := fcDefault;
font1 := PDF.AddFont('Arial', true, true, true, true, charset);
font2 := PDF.AddFont('Georgia', false, false, false, false, charset);
font3 := PDF.AddFont('Comic Sans MS', false, false, true, false, charset);
str := 'Here is the text. 0123456789.';
PDF.UseFont(font1, 14);
PDF.ShowTextAt(20, 20, str);
PDF.UseFont(font2, 14);
PDF.ShowTextAt(20, 40, str);
PDF.UseFont(font3, 14);
PDF.ShowTextAt(20, 60, str);
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
FontCharset charSet = fcDefault;
long font1 = PDF->AddFont("Arial", true, true, true, true, charset);
long font2 = PDF->AddFont("Georgia", false, false, false, false, charset);
long font3 = PDF->AddFont("Comic Sans MS", false, false, true, false, charset);
char* str = "Here is the text. 0123456789.";
PDF->UseFont(font1, 14);
PDF->ShowTextAt(20, 20, str);
PDF->UseFont(font2, 14);
PDF->ShowTextAt(20, 40, str);
PDF->UseFont(font3, 14);
PDF->ShowTextAt(20, 60, str);
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
FontCharset charSet = FontCharset.fcDefault;
long font1 = PDF.AddFont("Arial", true, true, true, true, charset);
long font2 = PDF.AddFont("Georgia", false, false, false, false, charset);
long font3 = PDF.AddFont("Comic Sans MS", false, false, true, false, charset);
string str = "Here is the text. 0123456789.";
PDF.UseFont(font1, 14);
PDF.ShowTextAt(20, 20, str);
PDF.UseFont(font2, 14);
PDF.ShowTextAt(20, 40, str);
PDF.UseFont(font3, 14);
PDF.ShowTextAt(20, 60, str);
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
charSet = 0 'FontCharset.fcDefault
font1 = PDF.AddFont("Arial", true, true, true, true, charset)
font2 = PDF.AddFont("Georgia", false, false, false, false, charset)
font3 = PDF.AddFont("Comic Sans MS", false, false, true, false, charset)
str = "Here is the text. 0123456789."
PDF.UseFont font1, 14
PDF.ShowTextAt 20, 20, str
PDF.UseFont font2, 14
PDF.ShowTextAt 20, 40, str
PDF.UseFont font3, 14
PDF.ShowTextAt 20, 60, str
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