I know this has been answered before, but when I look at the answers, I have to wonder if there is now an easier way.
Below is my code which is all I need to display working radio buttons. What is the minimum I need to do to set one of a group of buttons on by default? I'm hoping it's easier than all of https://www.mail-archive.com/[email protected]/msg08490.html but if that's really all necessary, so be it... Thanks, Gary private static void addRadiobuttonAtRect(PDPage page, PDAcroForm acroForm, String name, Map<String, String> optionMap, PDRectangle rect) { PDRadioButton radioButton = new PDRadioButton(acroForm); String grp = Utils.unescapeChar(optionMap.get("grp")); radioButton.setPartialName(grp); acroForm.getFields().add(radioButton); // Specify the annotation associated with the field and its location. PDAnnotationWidget widget = radioButton.getWidgets().get(0); widget.setRectangle(rect); rect.setLowerLeftX((float) (rect.getLowerLeftX() - 18)); rect.setUpperRightX((float) (rect.getLowerLeftX() + 10)); widget.setPage(page); PDAppearanceCharacteristicsDictionary fieldAppearance = new PDAppearanceCharacteristicsDictionary(new COSDictionary()); fieldAppearance.setBorderColour(Utils.hexToPDColor(optionMap.get("brdclr"))); fieldAppearance.setBackground(Utils.hexToPDColor(optionMap.get("bclr"))); widget.setAppearanceCharacteristics(fieldAppearance); // make sure the annotation is visible on screen and paper widget.setPrinted(true); // Add the annotation to the page try { page.getAnnotations().add(widget); } catch (IOException e) { e.printStackTrace(); } }

