Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0.28, 3.0.3 PDFBox
-
None
-
Mac Ventura, java 18 PDFBox 3.0.3, Tomcat 9
Linux; version: 5.15.0-105-generic, java 17, Tomcat 9.0.93
Description
After flattening a pdf acro form, value of some fields get blurred
PDDocument pdDocument = Loader.loadPDF(inFile, ""); pdDocument.setResourceCache(new DefaultResourceCache()); try { boolean save = false; if (pdDocument.isEncrypted()) { pdDocument.setAllSecurityToBeRemoved(true); save = true; } final PDDocumentCatalog pdDocumentCatalog = pdDocument.getDocumentCatalog(); if (pdDocumentCatalog != null) { final PDAcroForm pdForm = pdDocumentCatalog.getAcroForm(); if (pdForm != null) { pdForm.flatten(); save = true; } } if (save) { pdDocument.save(outFile); } } catch (Exception e) {}