Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaw in mozCurrentTransform polyfill #5828

Merged
merged 1 commit into from
Apr 29, 2015

Conversation

Rob--W
Copy link
Member

@Rob--W Rob--W commented Mar 11, 2015

Set transformation matrix in (polyfilled) mozPrintCallback when a scale is applied, and removed ctx._scaleX and ctx._scaleY in favor of ctx._transformMatrix to emphasize that the caller MUST ensure that the state of the matrix is correct before addContextCurrentTransform is called.

To verify that the bug is fixed:

  1. Start the PDF.js server (node make server)
  2. Download https://github.com/mumble-voip/mumble/blob/d73a2bb6962e5659c881ba789b40190bb04274a6/doc/mumble-protocol.pdf?raw=true
  3. Visit http://localhost:8888/web/viewer.html, click on Open file and select the PDF from step 2.
  4. Press the print button in the viewer to get a print preview.
  5. Scroll to page 4 (of the PDF, possibly page 7 if there is a blank page between each page (this is a different bug)) and check whether the images are aligned correctly (see screenshots in Printing images on chrome are scaled by 50% #5827).

Fixes #5505
Fixes #5827

(note: these bugs have been marked as Chrome-specific, but the bug is actually more general, it applies to every non-Firefox browser).

Set transformation matrix in (polyfilled) mozPrintCallback when a scale
is applied. Removed _scaleX and _scaleY in favor of _transformMatrix to
emphasize that the caller MUST ensure that the state of the matrix is
correct before `addContextCurrentTransform` is called.
@Rob--W
Copy link
Member Author

Rob--W commented Apr 28, 2015

This patch is easy to comprehend and verify, so could you review+merge it?

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/ad5790326396966/output.txt

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/f0140bf47ec47da/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/33528ec4fc6cd92/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/f0140bf47ec47da/output.txt

Total script time: 20.53 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/33528ec4fc6cd92/output.txt

Total script time: 23.00 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@timvandermeij
Copy link
Contributor

Fixes #5800.

timvandermeij added a commit that referenced this pull request Apr 29, 2015
Fix flaw in mozCurrentTransform polyfill
@timvandermeij timvandermeij merged commit 6159da0 into mozilla:master Apr 29, 2015
@timvandermeij
Copy link
Contributor

Thank you for the patch (fixes three issues), and sorry for the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants