You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rendering error, some text flipped across page #5946
A possible hint... there's a bug in the PDF specification: 12.5.5 Appearance Streams. Text is "Matrix shall be concatenated with A to form a matrix AA" should be "Matrix shall be concatenated to A to form a matrix AA" and the formula below must be changed too. This has been confirmed to me by somebody who has the PDF 2.0 specification.
I believe I found the cause and it is not related to my remark above. I modified the first file and enclosed the page content stream within q...Q, i.e. so that after rendering the page content, the graphics attributes would be reset to their original settings, and now this file and the one from #4743 (with the code change mentioned by @Osukaru) are properly displayed.
So a code change would be needed that resets something before rendering annotations.
if I've understood this correctly, you are creating a big list of operators with their parameters from the page content stream(s) and the content streams of the annotations. So if the page content stream(s) end with a flipped CTM (here: 1 0 0 -1 0 792 cm), the annotations will "inherit" that.
@yurydelendik@Snuffleupagus Do you perhaps have an idea for the above? It is affecting multiple PDFs in open issues, so it would really be nice to have this resolved.
What I meant is to save and restore before and after the main content stream. It is the main content stream that is the problem, i.e. if the main content stream doesn't reset all changes it has done.
I don't know enough about javascript, I remember you have some list of all operators with their parameters, ideally OPS.save should be inserted before everything, and OPS.restore at the end of the list, all that before you add the annotation content streams.
I believe I found the cause and it is not related to my remark above. I modified the first file and enclosed the page content stream within q...Q, i.e. so that after rendering the page content, the graphics attributes would be reset to their original settings, and now this file and the one from #4743 (with the code change mentioned by @Osukaru) are properly displayed.
So a code change would be needed that resets something before rendering annotations.
hey i have the same problem as stated above my electronic signature when viewed is seen upside down im in need of the modificatios you posted since the links are down if possible thank you
Activity
dacsy commentedon Nov 26, 2015
Is there any information about this yes ?
I am having this issues also
jethrogb commentedon Nov 26, 2015
I have yet to see a PDF.js bug I reported fixed.
dacsy commentedon Nov 26, 2015
Which version are you talking about ? I got the latest version: 1.2.109 and I still get the problem
THausherr commentedon Nov 30, 2015
Another (signature missing)
https://issues.apache.org/jira/secure/attachment/12636888/D.1_signiert.pdf (signature missing)
And another (yellow thing on page 1 missing):
http://www.filedropper.com/002698
THausherr commentedon Nov 30, 2015
A possible hint... there's a bug in the PDF specification: 12.5.5 Appearance Streams. Text is "Matrix shall be concatenated with A to form a matrix AA" should be "Matrix shall be concatenated to A to form a matrix AA" and the formula below must be changed too. This has been confirmed to me by somebody who has the PDF 2.0 specification.THausherr commentedon Dec 11, 2015
I believe I found the cause and it is not related to my remark above. I modified the first file and enclosed the page content stream within q...Q, i.e. so that after rendering the page content, the graphics attributes would be reset to their original settings, and now this file and the one from #4743 (with the code change mentioned by @Osukaru) are properly displayed.
So a code change would be needed that resets something before rendering annotations.
The modified files:
http://www.filedropper.com/pdfjs-5946unc
http://www.filedropper.com/test-signatureunc
THausherr commentedon Dec 11, 2015
This code in core.js:
if I've understood this correctly, you are creating a big list of operators with their parameters from the page content stream(s) and the content streams of the annotations. So if the page content stream(s) end with a flipped CTM (here: 1 0 0 -1 0 792 cm), the annotations will "inherit" that.
timvandermeij commentedon Dec 26, 2015
I'm a bit confused about this issue. We have https://github.com/mozilla/pdf.js/blob/master/src/display/canvas.js#L1839-L1846 which should take care of resetting the state already. I also tried adding explicit
saveandrestoreoperators aroundbeginAnnotationsandendAnnotationsat https://github.com/mozilla/pdf.js/blob/master/src/core/annotation.js#L396-L400, but also without luck. While @THausherr's explanation is very likely, I'm unsure why these changes have no effect. The issue does appear to be not properly resetting the state before drawing annotations, but I don't know of anything more we have for canvas drawing to achieve that if the current code is not doing that.@yurydelendik @Snuffleupagus Do you perhaps have an idea for the above? It is affecting multiple PDFs in open issues, so it would really be nice to have this resolved.
THausherr commentedon Dec 26, 2015
What I meant is to save and restore before and after the main content stream. It is the main content stream that is the problem, i.e. if the main content stream doesn't reset all changes it has done.
I don't know enough about javascript, I remember you have some list of all operators with their parameters, ideally OPS.save should be inserted before everything, and OPS.restore at the end of the list, all that before you add the annotation content streams.
Snuffleupagus commentedon Dec 28, 2015
@jethrogb Are you the creator of the PDF file (https://jbeekman.nl/github-mozilla-pdf.js-issue-5946.pdf), and if so may we include it in the test-suite?
jethrogb commentedon Dec 28, 2015
I'm not, and I don't know. I can try to get permission, but it'd be easier if you could recreate the test case.
Mirich2 commentedon Aug 31, 2022
hey i have the same problem as stated above my electronic signature when viewed is seen upside down im in need of the modificatios you posted since the links are down if possible thank you