I currently have a method that looks like this for making checkboxes on my pdf:
private static void createCheckbox(PdfWriter writer, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY, String fieldName, boolean startChecked) throws IOException, DocumentException {
RadioCheckField bt = new RadioCheckField(writer, new Rectangle(lowerLeftX, lowerLeftY, upperRightX, upperRightY), fieldName, "Yes");
bt.setCheckType(RadioCheckField.TYPE_CHECK);
bt.setBorderWidth(BaseField.BORDER_WIDTH_THIN);
bt.setBorderColor(Color.BLACK);
bt.setBackgroundColor(Color.WHITE);
bt.setChecked(startChecked);
bt.setOptions(RadioCheckField.READ_ONLY);
PdfFormField ck = bt.getCheckField();
writer.addAnnotation(ck);
}
This lets me send in lower left X and Y coords and upper right X and Y coords in order to make a box. This seems to work fine on the first page of a document where I create checkboxes. If I try making them on later pages, they just don’t appear.
Example: I make a PDF form some text on page one, make a new page, add more info plus checkboxes, make a new page, add more info and checkboxes. That last page will not actually display checkboxes even if I use the same code for both pages with checkboxes.
Try putting a different name on each page. Field names are document-wide.