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 Create Graphics in PDF Document Using Patterns

Example
Collapse All

Example

C++

[copy to clipboard]
PM_DOCUMENT doc = PM_DOCUMENT_New();
PM_RECT rect = {0, 0, 300, 300};
PM_PAGE page = PM_DOCUMENT_AddPage(doc, rect);

PM_CANVAS canvas = PM_PAGE_GetCanvas(page);
PM_RECT bbox = {0, 0, 200, 200};
PM_CANVAS xCanvas = PM_FORM_XOBJECT_GetCanvas(PM_DOCUMENT_AddFormXObject(doc, bbox));
PM_CANVAS_DrawRectangle(xCanvas, 0, 0, 200, 200, 0);
PM_CANVAS_FillAndStroke(xCanvas);
PM_CANVAS_DrawFormXObject(canvas, xCanvas, 100, 100, 200, 200);

PM_CANVAS pCanvas = PM_TILING_PATTERN_GetCanvas(PM_DOCUMENT_AddColoredTilingPattern(doc, ttConstantSpacing, bbox, 50, 50));
PM_CANVAS_DrawCircle(pCanvas, 10, 10, 5);
PM_CANVAS_FillAndStroke(pCanvas);
PM_CANVAS_SetTilingPatternFill(canvas, pCanvas);
PM_CANVAS_DrawRectangle(canvas, 0, 0, 100, 100, 0);
PM_CANVAS_Fill(canvas);

PM_DOCUMENT_Save(doc, "PatternsAndXObject.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