[
https://issues.apache.org/jira/browse/PDFBOX-1074?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tilman Hausherr resolved PDFBOX-1074.
-------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.0
1.8.5
I'm setting this issue to resolved because I solved the problem with the s2
file.
[[email protected]] if you have another PDF please open a new issue
for it (unless you already did?). My solution only solves EncodedByteAlign for
Group 4 encoding, not for the two other Fax encodings because I don't have a
test file.
> TIFFFaxDecoder5 when using PDFImageWriter
> -----------------------------------------
>
> Key: PDFBOX-1074
> URL: https://issues.apache.org/jira/browse/PDFBOX-1074
> Project: PDFBox
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 1.6.0, 1.8.4, 1.8.5
> Reporter: Anton Stremoukhov
> Assignee: Andreas Lehmkühler
> Labels: CCITTFaxDecode, ccitt
> Fix For: 1.8.5, 2.0.0
>
> Attachments: 34315.pdf, page_83.pdf, s2130312-100.pdf,
> s2130312-100.pdf-1.tif, s2130312.pdf
>
>
> 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(i);
> String fileNameNew = "page_" + i + ".pdf";
> writeDocument(pageDoc, new File(destDir, fileNameNew).getPath());
> pageDoc.close();
> }
> fis.close();
> cosDoc.close();
> pdDoc.close();
--
This message was sent by Atlassian JIRA
(v6.2#6252)