Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5878

pdf form field text gets blurred after flattening

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.28, 3.0.3 PDFBox
    • None
    • AcroForm
    • 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) {}
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            jezerinac Joseph Jezerinac
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: