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 RGB Color Space in PDF and Draw Rectangles

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);

for (int i = 0; i < 5; i++)
{
        // RGB ([0.0;1.0],[0.0;1.0], [0.0;1.0]) 
        PM_CANVAS_SetRGBColorFill(canvas, 0.05*i, 1-0.1*i, 0.5-0.05*i);
	PM_CANVAS_DrawRectangle(canvas, 10 + 20*i, 10 + 20*i, 70, 100, 0);
	PM_CANVAS_FillAndStroke(canvas);
}

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