[
https://issues.apache.org/jira/browse/PDFBOX-3589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15693002#comment-15693002
]
Andrea Vacondio commented on PDFBOX-3589:
-----------------------------------------
I made some test with the doc I have, I can't share it unfortunately, but it
seems Acrobat and pdf.js do the same thing and in this case the --242 is seen
by Acrobat Reader as a -242. I tried a quick change in PDFBox to return -242
instead of 0 and the PDFDebugger renders the page exactly as Acrobat while if I
change it to return 0, everything is off. Unfortunately I couldn't figure what
is driving this and I'm not even sure if this is worth further investigation,
but I wanted to share my findings.
> Double negative float
> ---------------------
>
> Key: PDFBOX-3589
> URL: https://issues.apache.org/jira/browse/PDFBOX-3589
> Project: PDFBox
> Issue Type: Improvement
> Components: Parsing
> Affects Versions: 2.0.3
> Environment: Latest 2.0.x checked out the 22nd of November
> Reporter: Andrea Vacondio
> Priority: Minor
> Attachments: PDFBOX-3589.pdf
>
>
> We have a document where the content stream contains a float with double
> negative so something like --242.0 and this result in a wrong operator:
> {code}
> 0 -242.0 72.08 TD
> {code}
> while it should be
> {code}
> -242.0 72.08 TD
> {code}
> Compared to Acrobat Reader or pdf.js, this results in missing text when
> rendering the page. Here is a relevant section in pdf.js source code:
> {code}
> if (ch === 0x2D) { // '-'
> sign = -1;
> ch = this.nextChar();
> if (ch === 0x2D) { // '-'
> // Ignore double negative (this is consistent with Adobe Reader).
> ch = this.nextChar();
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]