Checkbox is invisible after deselecting in iOS.

21 views
Skip to first unread message

Amit Bobade

unread,
Feb 10, 2014, 10:48:57 AM2/10/14
to pdfne...@googlegroups.com
I am creating checkbox in iOS on PDF. But my checkbox is disappears after uncheking the checbox field.
I also tried to use custom appearance method from sample. But still same result. Can any one help me to resolve this.

Sample source code1 : using sample method.
Obj* CreateCheckmarkAppearance(PDFDoc *doc, enum CheckStyle style)
{
// Create a checkmark appearance stream ------------------------------------
ElementBuilder *build = [[ElementBuilder alloc] init];
ElementWriter *writer = [[ElementWriter alloc] init];

SDFDoc *s = [doc GetSDFDoc];

[writer WriterBeginWithSDFDoc: s compress: YES];
[writer WriteElement: [build CreateTextBegin]];

NSString* symbol = @"\154";
switch (style) {
case e_circle: symbol = @"\154"; break;
case e_diamond: symbol = @"\165"; break;
case e_cross: symbol = @"\65"; break;
case e_square: symbol = @"\156"; break;
case e_star: symbol = @"\110"; break;
// ...
// See section D.4 "ZapfDingbats Set and Encoding" in PDF Reference Manual
// (http://www.pdftron.com/downloads/PDFReference16.pdf) for the complete
// graphical map for ZapfDingbats font. Please note that all character codes
// are represented using the 'octal' notation.
default: // e_tick
symbol = @"\64";
}

Element *checkmark = [build CreateTextRunWithFont: symbol font: [Font Create: s type: e_zapf_dingbats embed: NO] font_sz: 1];
[writer WriteElement: checkmark];
[writer WriteElement: [build CreateTextEnd]];

Obj *stm = [writer End];
[stm PutRect: @"BBox" x1: -0.2 y1: -0.2 x2: 1 y2: 1]; // Clip
[stm PutName: @"Subtype" name: @"Form"];
return stm;
}


Sample Second : tField = [docToOpen FieldCreateWithString: @"Checkbox" type: e_check field_value: value def_field_value: @""];

Reply all
Reply to author
Forward
0 new messages