PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllAdds a system font using font face, font style and character set specified and return a font identifier.
|
| 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
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
Reference


