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

TIFFFaxDecoder5 when using PDFImageWriter

    Details

      Description

      I'm getting this when I try to PDFImageWriter.writeImage() on a PDF with one page (see attached page_83.pdf):
      Caused by: java.lang.Error: TIFFFaxDecoder5
      at org.apache.pdfbox.filter.TIFFFaxDecoder.decodeT6(TIFFFaxDecoder.java:1005)
      at org.apache.pdfbox.filter.CCITTFaxDecodeFilter.decode(CCITTFaxDecodeFilter.java:101)
      at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:279)
      at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:221)
      at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:156)
      at org.apache.pdfbox.pdmodel.graphics.xobject.PDCcitt.getRGBImage(PDCcitt.java:153)
      at org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:78)
      at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:551)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:274)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
      at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225)
      at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:107)
      at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:722)
      at org.apache.pdfbox.util.PDFImageWriter.writeImage(PDFImageWriter.java:135)
      at org.apache.pdfbox.util.PDFImageWriter.writeImage(PDFImageWriter.java:105)

      If you look on the pdf file i'm using (see attached page_83.pdf) you'll notice its completely blank, but this is ok - page was obtained from source pdf file with 84 pages where the last one is blank (see attached 34315.pdf).
      Source pdf has been splitted on pages (without any errors) via Splitter like so:

      FileInputStream fis = new FileInputStream(file);
      PDFParser parser = new PDFParser(fis);
      parser.parse();
      COSDocument cosDoc = parser.getDocument();
      PDDocument pdDoc = new PDDocument(cosDoc);

      Splitter splitter = new Splitter();
      List<PDDocument> pages = splitter.split(pdDoc);

      for (int i = 0; i < pages.size(); i++){
      PDDocument pageDoc = pages.get;
      String fileNameNew = "page_" + i + ".pdf";
      writeDocument(pageDoc, new File(destDir, fileNameNew).getPath());
      pageDoc.close();
      }

      fis.close();
      cosDoc.close();
      pdDoc.close();

        Attachments

        1. 34315.pdf
          4.79 MB
          Anton Stremoukhov
        2. page_83.pdf
          1 kB
          Anton Stremoukhov
        3. s2130312.pdf
          9.61 MB
          Anton Stremoukhov
        4. s2130312-100.pdf
          27 kB
          Anton Stremoukhov
        5. s2130312-100.pdf-1.tif
          34 kB
          Tilman Hausherr

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              delson Anton Stremoukhov
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: