This method adds a font from a file using the specified character set and font style and returns a font identifier.
You can pass the path to any font file as a parameter (TTF, OTFÂ or Type1).
LONG AddFontFromFile ( BSTR filename, VARIANT_BOOL bold, VARIANT_BOOL italic, VARIANT_BOOL underline, VARIANT_BOOL strikeout ) |
// PDF object is supposed to be created fnt := PDF.AddFontFromFile('path\to\font.ttf', false, false, true, false); PDF.UseFont(fnt, 14); PDF.ShowTextAt(20, 20, 'Here is the text. 0123456789.'); PDF.SaveToFile('test.pdf', true);
// PDF object is supposed to be created long fnt = PDF->AddFontFromFile("path\\to\\font.ttf", false, false, true, false); PDF->UseFont(fnt, 14); PDF->ShowTextAt(20, 20, "Here is the text. 0123456789."); PDF->SaveToFile("test.pdf", true);
// PDF object is supposed to be created long fnt = PDF.AddFontFromFile(@"path\to\font.ttf", false, false, true, false); PDF.UseFont(fnt, 14); PDF.ShowTextAt(20, 20, "Here is the text. 0123456789."); PDF.SaveToFile("test.pdf", true);
' PDF object is supposed to be created fnt = PDF.AddFontFromFile("path\to\font.ttf", false, false, true, false) PDF.UseFont fnt, 14 PDF.ShowTextAt 20, 20, "Here is the text. 0123456789." PDF.SaveToFile "test.pdf", true