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

PDFBox is unable to remove ID

    XMLWordPrintableJSON

Details

    Description

      I tried to remove ID from a PDF file using PDFBox. Any of my attemps haven't resulted in ID being removed. Please have a look how I tried to do so:

      if ( document.getDocument().getDocumentID() != null ) {
      // 1. doesn't work
      document.getDocument().setDocumentID(null);
      //2. doesn't work either
      document.getDocument().getTrailer().removeItem(COSName.ID);
      // 3. doesn't work
      final COSDictionary newTrailer = document.getDocument().getTrailer();
      newTrailer.removeItem(COSName.ENCRYPT);
      newTrailer.removeItem(COSName.ID);
      document.getDocument().setTrailer(newTrailer);
      // 4. doesn't work
      final COSArray documentID = document.getDocument().getDocumentID();
      documentID.clear();
      document.getDocument().setDocumentID(documentID);
      }

      Who I can send a source PDF to?

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            menteith85 menteith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: