Shifted view in PDF with cm command after path construction.
Categories
(Firefox :: PDF Viewer, defect, P3)
Tracking
()
People
(Reporter: alex, Unassigned)
References
Details
Attachments
(1 file)
3.11 KB,
application/pdf
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
Steps to reproduce:
Open the attached PDF file as File->Open
Actual results:
Black line is shifted down relatively to the red square.
Expected results:
Black line must be on about the same level. See how Acrobat Reader, Evince or Ghostscript render the sample file.
Comment 1•3 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•3 days ago
|
||
The %
preceding the cm
command is treated as a comment delimiter, hence the cm
is just ignored.
From the specs:
7.2.3 Comments
Any occurrence of the PERCENT SIGN (25h) outside a string or stream introduces a comment. The comment
consists of all characters after the PERCENT SIGN and up to but not including the end of the line, including
regular, delimiter, SPACE (20h), and HORZONTAL TAB characters (09h). A conforming reader shall ignore
comments, and treat them as single white-space characters. That is, a comment separates the token preceding
it from the one following it.
so the percent sign should just be ignored.
Comment 3•3 days ago
|
||
(In reply to Calixte Denizet (:calixte) from comment #2)
The
%
preceding thecm
command is treated as a comment delimiter, hence thecm
is just ignored.
From the specs:7.2.3 Comments
Any occurrence of the PERCENT SIGN (25h) outside a string or stream introduces a comment. The comment
consists of all characters after the PERCENT SIGN and up to but not including the end of the line, including
regular, delimiter, SPACE (20h), and HORZONTAL TAB characters (09h). A conforming reader shall ignore
comments, and treat them as single white-space characters. That is, a comment separates the token preceding
it from the one following it.so the percent sign should just be ignored.
Unfortunately it doesn't seem to be that easy, since it's not uncommon for streams to contain comments and just ignoring the %
-character will thus break many more cases than it'd fix.
Comment 4•3 days ago
|
||
So my comment was wrong: the percent sign is used for comments even in streams.
The test case can be reduced to:
q
0 0 200 5 re
300 0 200 5 re
1 0 0 1 0 700 cm
f
Q
In pdf.js we create two rectangle on the bottom of the page, set the current transform and then fill the rectangles. In the canvas the current transform isn't applied to the current path...
Updated•3 days ago
|
Description
•