[
https://issues.apache.org/jira/browse/PDFBOX-4317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16614567#comment-16614567
]
CAP commented on PDFBOX-4317:
-----------------------------
*Update:*
The JPEG is using Huffman progressive encoding. Some of those progressive JPEG
images (not all) cause this problem. Following the PDF reference manual,
progressive encoding should be supported by PDF files via the DCTDecode filter:
*(DCTDecode filter - chapter 7.4.8 - PDF 32000-1:2008)*
_"In addition to the baseline JPEG format, beginning with PDF 1.3, the
DCTDecode filter shall support the progressive JPEG extension. This extension
does not add any entries to the DCTDecode parameter dictionary; the distinction
between baseline and progressive JPEG shall be represented in the encoded
data."_
Either the said _"representation in the encoded data"_ is missing, or the said
Adobe applications are not well prepared to display such JPEGs. Adobe won't fix
it and has already been asked. We are completly unsure if PDFbox is causing a
problem at all. However we also can not definately claim, that the stream
created by PDFbox does contain everything needed (for PDF viewers) to display
such images.
It is entirely possible, that Adobe is causing the problem, by not being able
to handle some minor property or detail of _some_ progressive JPEG files.
> Some feature of the given JPEG leads to erroneous results, when adding
> (drawing) it to a PDPageContentStream.
> -------------------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-4317
> URL: https://issues.apache.org/jira/browse/PDFBOX-4317
> Project: PDFBox
> Issue Type: Bug
> Components: Writing
> Affects Versions: 2.0.9
> Reporter: CAP
> Priority: Major
> Attachments: IMG-20180719-WA0000.jpg, UsingAdobeDC.pdf,
> image-2018-09-14-09-13-56-216.png, image-2018-09-14-09-14-45-358.png,
> image-2018-09-14-09-15-40-860.png, out.pdf
>
>
> Some feature of the given JPEG leads to erroneous results, when adding
> (drawing) it to a PDPageContentStream.
> The document itself is created just fine and the page is displayable in the
> "PDF Debugger" application, but for example the Adobe Reader is reporting an
> "internal Error", when opening the created PDF.
> Reproducable via:
> {code:java}
> try(PDDocument document = new PDDocument()){
> PDPage page = new PDPage();
> try(PDPageContentStream pcs = new PDPageContentStream(document, page)){
> PDImageXObject pdImage = PDImageXObject.createFromFile("path to jpeg",
> document);
> pcs.drawImage(pdImage, 30, 30);
> }
> document.addPage(page);
> document.save(new File("output file"));
> }{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]