How do I create a Combo field?

51 views
Skip to first unread message

Ryan

unread,
Mar 1, 2016, 2:27:14 AM3/1/16
to PDFTron PDFNet SDK
Question: 

How do I create a Combo field?

Answer: 

A combo field is a special type of choice field.

Field combo = doc.FieldCreate("my_combo", Field.Type.e_choice);
combo.SetFlag(Field.Flag.e_combo, true);
Obj options_array = combo.GetSDFObj().PutArray("Opt");
// Add options...
options_array.PushBackString("Item5");
options_array.PushBackString("Item6");
// Now create visual representation of field and add to page
pdftron.PDF.Annots.Widget combo_widget = pdftron.PDF.Annots.Widget.Create(sdfdoc, new Rect(50, 550, 350, 600), combo);
page.PushBack(combo_widget);


Reply all
Reply to author
Forward
0 new messages