How can I make sure my radio buttons are round instead of square?

118 views
Skip to first unread message

Aaron

unread,
Jul 30, 2014, 6:35:48 PM7/30/14
to pdfne...@googlegroups.com
Q:

I am trying to take a set of radio buttons (including their value) and move them from one PDF to another programmatically with the PDFNet SDK. I think I’ve extracted all the relevant data, but when I re-create the objects in the new PDF, I end up with two check boxes instead of two radio buttons, despite creating the field as e_radio.
Can you provide some sample code with how to do this operation?
Thank you!

P.S. My code is below;

var newField = Document.FieldCreate(FieldName, Field.Type.e_radio, "", "");
for (int i = 0; i <= 18; i++)
   newField.SetFlag((Field.Flag)i, FlagStates[i]);
for (int i = 0; i <= NUM_RADIO_BUTTONS; i++)
{
   var annot = Widget.Create(Document.GetSDFDoc(), OriginalBoundingBox, newField);
  annot.SetBorderColor(new ColorPt(0,0,0),3);
  Page.AnnotPushBack(annot);
   annot.RefreshAppearance();
}
newField.SetValue(ORIGINAL_SELECTED_VALUE);

A:

To get the proper "round" button appearance you will need to add a call to Annot.SetStaticCaptionText("l"
), such as:

var annot = Widget.Create(...);
annot.SetBorderColor(new ColorPt(0,0,0),3);
annot.SetStaticCaptionText("l");
Page.AnnotPushBack(annot);

Ryan

unread,
Jun 8, 2015, 1:44:26 PM6/8/15
to pdfne...@googlegroups.com
Other options to pass into SetStaticCaptionText for check boxes and radio buttons are...

"4" = Tick
"l" = Circle
"8" = Cross
"u" = diamond
"n" = square
"H" = star



Reply all
Reply to author
Forward
0 new messages