Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
How to Use Fonts

Example
Collapse All

Example

C++

[copy to clipboard]
PM_DOCUMENT doc = PM_DOCUMENT_New();
PM_RECT rc = {0, 0, 500, 500};
PM_PAGE page = PM_DOCUMENT_AddPage(doc, rc);
PM_FONT font1 = PM_DOCUMENT_AddFont(doc, "Arial", false, false);
PM_FONT font2 = PM_DOCUMENT_AddFont(doc, "Times", false, true);
PM_FONT font3 = PM_DOCUMENT_AddFontFromFile(doc, "symbol.ttf");
PM_CANVAS canvas = PM_PAGE_GetCanvas(page);
	
PM_CANVAS_UseFont(canvas, font1, 12); 
PM_CANVAS_ShowText(canvas, 10, 160,"The system font.", 0);

PM_CANVAS_UseFont(canvas, font2, 12); 
PM_CANVAS_ShowText(canvas, 10, 130,"The standart font.", 0);

PM_CANVAS_UseFont(canvas, font3, 12); 
PM_CANVAS_ShowText(canvas, 10, 100,"Font from file.", 0);

PM_DOCUMENT_Save(doc, "Fonts.pdf");
PM_DOCUMENT_Free(doc);

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots