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

COSWriter.visitFromStream() does not close InputStream.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0, 1.5.0
    • Fix Version/s: 1.6.0
    • Component/s: Writing
    • Labels:
      None
    • Environment:
      all

      Description

      We use pdfbox inside apache-karaf to write complex PDF files.

      Therefore we are including several COSStreams in the PDF file to be written. Some of the COSStream's use a scratch file for storing the stream content.

      Inspecting the open files of my apache-karaf unveiled, that these scratch files a still open after writing the PDDocument and closing it.

      Therefore I inspected the code inside COSWriter.visitFromStream(COSStream) and found out, the the InputStream name 'input' opened right at the beginning is never closed.

      Please add a finally-clause, which robustely closes this input stream.

      I inspected pdfbox-1.4.0 and the current SVN revision under

      http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java?revision=1092855&view=markup

      I would be very nice, if this issue could be fixed before pdfbox-1.6.0

      TIA and best regards, Wolfgang

        Attachments

          Activity

            People

            • Assignee:
              lehmi Andreas Lehmkühler
              Reporter:
              wolfgang.glas@ev-i.at Wolfgang Glas
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: