Hi Team, I am ticking the checkbox using below try {
PDDocument pDDocument = Loader.loadPDF(new File("src/main/resources", "80.pdf")); if (pDDocument.isEncrypted()) { try { PDAcroForm pDAcroForm = pDDocument.getDocumentCatalog().getAcroForm(); COSDictionary cosDictionary3 = pDAcroForm.getField("ap.sex").getCOSObject(); cosDictionary3.setString(COSName.V, "male"); OR FileOutputStream fileOutputStream = new FileOutputStream(new File("src/main/resources", "incrementalSave.pdf")); Set<COSDictionary> set = new HashSet<>(); set.add(cosDictionary1); set.add(cosDictionary2); set.add(cosDictionary3); pDDocument.saveIncremental(fileOutputStream, set); pDDocument.close(); }