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 draw simple elements, such as a rectangle and ellipses

Example
Collapse All

Example

C++

[copy to clipboard]
PM_DOCUMENT doc = PM_DOCUMENT_New();

PM_RECT rc = {0, 0, 600, 800};
PM_PAGE page = PM_DOCUMENT_AddPage(doc, rc);
PM_CANVAS canvas = PM_PAGE_GetCanvas(page);
	
PM_CANVAS_SetLineWidth(canvas, 5);

PM_CANVAS_DrawRectangle(canvas, 100, 100, 100, 50, 0);
PM_CANVAS_FillAndStroke(canvas);
PM_CANVAS_DrawRectangle(canvas, 200, 200, 100, 50, 45);
PM_CANVAS_FillAndStroke(canvas);

PM_CANVAS_DrawRoundRectangle(canvas, 20, 20, 100, 60, 10, 5);
PM_CANVAS_Stroke(canvas);
	
PM_CANVAS_TranslateCoords(canvas, 0, 0);

PM_CANVAS_DrawEllipse(canvas, 50, 50, 100, 100);
PM_CANVAS_DrawEllipse(canvas, -200, 0, -100, 150);
PM_CANVAS_AlternateFillAndStroke(canvas);
	
PM_DOCUMENT_Save(doc, "RectanglesAndCircles.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