[
https://issues.apache.org/jira/browse/PDFBOX-2070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tilman Hausherr resolved PDFBOX-2070.
-------------------------------------
Resolution: Fixed
Assignee: Tilman Hausherr
I'm not happy that three classes (ccitt filter: sets DeviceGray if not set;
jbig2 filter: sets DeviceGray if not set; jpx filter: sets BPC, Decode, width,
height, colorspace) alter the pdf (oops, that was my idea a few months ago),
but I don't have a better idea. Correcting this will possibly require major
changes. Thus setting to resolved for now, as the original bug is fixed.
> Filter.decode() modifies PDF if there is a filter array
> -------------------------------------------------------
>
> Key: PDFBOX-2070
> URL: https://issues.apache.org/jira/browse/PDFBOX-2070
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.0
> Reporter: Tilman Hausherr
> Assignee: Tilman Hausherr
> Fix For: 2.0.0
>
> Attachments: after.pdf, before.pdf
>
>
> If there are several filters (filter array) in an image, PDFBox is inserting
> an empty DecodeParms object here
> {code}
> params.setItem(COSName.DECODE_PARMS, getDecodeParams(params, index));
> {code}
> instead of either inserting an empty COSArray, or (better) do nothing. Saving
> such a PDF results in it not being displayable in the Acrobat Reader.
> Test code:
> {code}
> PDDocument d = PDDocument.load("before.pdf");
> new PDFRenderer(d).renderImage(0);
> d.save("after.pdf");
> {code}
> The rendering is important because without it, the filtered objects aren't
> decoded.
--
This message was sent by Atlassian JIRA
(v6.2#6252)