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 a CheckBox

Example
Collapse All

Example

C++

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

PM_RECT rc = {0, 0, 600, 800};
PM_RECT rcCheckBox1 = {110, 760, 140, 790};
PM_RECT rcCheckBox2 = {110, 730, 140, 760};
PM_PAGE page = PM_DOCUMENT_AddPage(doc, rc);
	
PM_COLOR colorCheckBoxText1;
colorCheckBoxText1.n = 3;
// Number n determines the color space
// 3 - Device RGB
colorCheckBoxText1.value[0] = 255;  //Red
colorCheckBoxText1.value[1] = 0;    //Green
colorCheckBoxText1.value[2] = 0;    //Blue
colorCheckBoxText1.value[3] = 0;    //Alpha
PM_ANNOTATION checkBox1 = PM_PAGE_AddCheckBox(page, rcCheckBox1, "First", doc); 
PM_ANNOT_WIDGET_CHECKBOX_SetExportValue(checkBox1,"First");
PM_ANNOT_WIDGET_CHECKBOX_SetTextColor(checkBox1, doc, colorCheckBoxText1);

PM_COLOR colorCheckBoxText2;
colorCheckBoxText2.n = 3;
// Number n determines the color space
// 3 - Device RGB

colorCheckBoxText2.value[0] = 0;  //Red
colorCheckBoxText2.value[1] = 0;    //Green
colorCheckBoxText2.value[2] = 255;    //Blue
colorCheckBoxText2.value[3] = 0;    //Alpha

PM_ANNOTATION checkBox2 = PM_PAGE_AddCheckBox(page, rcCheckBox2, "Second", doc); 
PM_ANNOT_WIDGET_CHECKBOX_SetExportValue(checkBox2,"Second");
PM_ANNOT_WIDGET_CHECKBOX_SetTextColor(checkBox2, doc, colorCheckBoxText2);

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