PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllGets or sets the style for embedded fonts in the current document.
|
| EmbedStyle FontEmbedStyle { get; set; } |
Value
Remarks
FontEmbedStyle gets or sets the style for embedded fonts in the current document. Using font embedding styles, instead of direct font naming, can decrease the size of the generated PDF document.
Example
Embeding a font in PDF document
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.FontEmbedStyle := EmbedStyle.esNotEmbed;
{ If we embed all used fonts in document then file size will }
{ be larger but anyone will be able to view this document even }
{ without needed fonts installed in the system. }
fnt1 := PDF.AddBuiltInFont(bfHelveticaOblique, false, false);
fnt2 := PDF.AddFont('Arial', false, false, false, false, fcDefault);
PDF.UseFont(fnt1, 14);
PDF.ShowTextAt(20, 20, 'Text1.');
PDF.UseFont(fnt2, 14);
PDF.ShowTextAt(20, 40, 'Text2.');
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->FontEmbedStyle = esNotEmbed;
// If we embed all used fonts in document then file size will
// be larger but anyone will be able to view this document even
// without needed fonts installed in the system.
long fnt1 = PDF->AddBuiltInFont(bfHelveticaOblique, false, false);
long fnt2 = PDF->AddFont("Arial", false, false, false, false, fcDefault);
PDF->UseFont(fnt1, 14);
PDF->ShowTextAt(20, 20, "Text1.");
PDF->UseFont(fnt2, 14);
PDF->ShowTextAt(20, 40, "Text2.");
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.FontEmbedStyle = EmbedStyle.esNotEmbed;
// If we embed all used fonts in document then file size will
// be larger but anyone will be able to view this document even
// without needed fonts installed in the system.
long fnt1 = PDF.AddBuiltInFont(BuiltInFont.bfHelveticaOblique, false, false);
long fnt2 = PDF.AddFont("Arial", false, false, false, false, FontCharset.fcDefault);
PDF.UseFont(fnt1, 14);
PDF.ShowTextAt(20, 20, "Text1.");
PDF.UseFont(fnt2, 14);
PDF.ShowTextAt(20, 40, "Text2.");
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.FontEmbedStyle = 2 'EmbedStyle.esNotEmbed
' If we embed all used fonts in document then file size will
' be larger but anyone will be able to view this document even
' without needed fonts installed in the system.
fnt1 = PDF.AddBuiltInFont(9, false, false) 'BuiltInFont.bfHelveticaOblique
fnt2 = PDF.AddFont("Arial", false, false, false, false, 0) 'FontCharset.fcDefault
PDF.UseFont fnt1, 14
PDF.ShowTextAt 20, 20, "Text1."
PDF.UseFont fnt2, 14
PDF.ShowTextAt 20, 40, "Text2."
PDF.SaveToFile "test.pdf", true
See Also
Reference


