How to set a checkbox in a PDF form using Java PDFBOX api
Initially, I tried using the code below, but after the “Execution” check box is invisible in PDF, but it was checked .. how to avoid such circumstances or are they, as I implemented, incorrect? can someone help me
public void check() throws Exception { PDDocument fdeb = null; fdeb = PDDocument.load( "C:\\Users\\34\\Desktop\\complaintform.pdf" ); PDAcroForm form = fdeb.getDocumentCatalog().getAcroForm(); PDField feld3 = form.getField( "check" ); feld3.setValue("check"); fdeb.save("C:\\Users\\34\\Desktop\\complaintform.pdf"); fdeb.close(); }
thanks
source share