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

Getting "Error: The supplied password does not match either the owner or user password in the document." while trying to parse pdf without password in

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.8.8
    • Fix Version/s: None
    • Component/s: Parsing
    • Labels:
      None

      Description

      I have a pdf that was correctly parsed for some time and suddenly I've got "javax.crypto.BadPaddingException: Given final block not properly padded" when I tried to parse it with pdfbox-1.8.7. Then I tried pdfbox-1.8.8-SNAPSHOT and I've got "Error: The supplied password does not match either the owner or user password in the document.". Here is the code I'm using:

      ContentHandler handler = new BodyContentHandler(400000);
      Metadata metadata = new Metadata();
      Parser parser = new AutoDetectParser();

      try (TikaInputStream stream = TikaInputStream.get(input))

      { parser.parse(stream, handler, metadata, new ParseContext()); }

      catch (IOException | SAXException | TikaException e)

      { LOG.error("Could not parse the input document", e); }

      return handler.toString();

      (I am using it with tika-parsers-1.6)

        Attachments

        1. DV.pdf
          280 kB
          Ekaterina

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kitkate87 Ekaterina
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: