Skip to content

Rotate landscape pages, during printing, by default in the viewer (enablePrintAutoRotate = true) #13120

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

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

While this will perhaps not be perfect for every PDF document with mixed page orientation, based on the large number of bugs/issues seen over the years I'm however pretty convinced that it'll be an overall improvement in a majority of cases.

In order to improve things further, we'd probably need Firefox to support e.g. @page such that the viewer can provide better information to the print engine.

@Snuffleupagus Snuffleupagus force-pushed the enablePrintAutoRotate-true branch from cc8ed11 to 942f680 Compare March 19, 2021 11:36
…ntAutoRotate = true` set

Currently landscape pages are rotated *clockwise*, which for most documents feel wrong since holding the printed pages at their *left* edge causes the landscape pages to be viewed "upside down".
In general, since most documents are LTR ones, it feels more appropriate to instead rotate landscape pages *counterclockwise* for printing.
@Snuffleupagus Snuffleupagus force-pushed the enablePrintAutoRotate-true branch from 942f680 to c38b00a Compare March 19, 2021 11:38
Currently, with `enablePrintAutoRotate = true` set, we're forced to loop through all the pages *twice* when checking for any landscape pages.
This seems completely unnecessary now, and using only *one* loop should be marginally more efficient in general.
@Snuffleupagus Snuffleupagus force-pushed the enablePrintAutoRotate-true branch from c38b00a to 30c0684 Compare March 19, 2021 11:39
…nablePrintAutoRotate = true`)

While this will perhaps not be perfect for *every* PDF document with mixed page orientation, based on the large number of bugs/issues seen over the years I'm however pretty convinced that it'll be an overall improvement in a majority of cases.

In order to improve things further, we'd probably need Firefox to support e.g. `@page` such that the viewer can provide better information to the print engine.
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/a8251f199106dbd/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/a8251f199106dbd/output.txt

Total script time: 4.45 mins

Published

@timvandermeij timvandermeij merged commit 8a820ac into mozilla:master Mar 19, 2021
@timvandermeij
Copy link
Contributor

Good idea!

@Snuffleupagus Snuffleupagus deleted the enablePrintAutoRotate-true branch March 19, 2021 22:19
mcbnix pushed a commit to MasterControlIncPublic/pdf.js that referenced this pull request Dec 8, 2022
…landscape pages, during printing, by default in the viewer (enablePrintAutoRotate = true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants