PdfReader reader = new PdfReader("in.pdf");
PdfStamper stamper = new PdfStamper(reader, "out.pdf");
PdfWriter writer = stamper.getWriter();
Rectangle position = new Rectangle(36, 760, 144, 790);
//
// how?
//
stamper.close();
reader.close();
P.S。 PDF中没有表格
P.P.S。 itext 2.1.7
答案 0 :(得分:1)
想出来:
RadioCheckField checkbox = new RadioCheckField(writer, rect, "a-name", "Yes");
checkbox.setCheckType(RadioCheckField.TYPE_CHECK);
checkbox.setChecked(true);
checkbox.setBorderWidth(BaseField.BORDER_WIDTH_THICK);
checkbox.setBorderColor(Color.BLACK);
checkbox.setBackgroundColor(Color.WHITE);
stamper.addAnnotation(checkbox.getCheckField(), 1);