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

"Cannot save a document which has been closed" when encrypting

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • PDModel
    • None
    • java7 deb7

    Description

      InputStream content = ...;
      int keyLength = 256;
      AccessPermission ap = new AccessPermission();
      StandardProtectionPolicy spp = new StandardProtectionPolicy(
      symmPw, symmPw, ap);
      spp.setEncryptionKeyLength(keyLength);
      document.protect(spp);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      document.save(baos);

      in the save() the above mentioned exception is thrown (wasn't with the 2013-11 snapshot)

      Attachments

        1. patch2447b.txt
          0.9 kB
          Ralf Hauser
        2. patch2447a.txt
          0.9 kB
          Ralf Hauser
        3. patch2447.txt
          0.6 kB
          Ralf Hauser

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              hauser@acm.org Ralf Hauser
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: