Skip to content

printing not correct for landscape #2851

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

Closed
ce03 opened this issue Mar 1, 2013 · 7 comments
Closed

printing not correct for landscape #2851

ce03 opened this issue Mar 1, 2013 · 7 comments
Labels

Comments

@ce03
Copy link

ce03 commented Mar 1, 2013

This pdf file is landscape, and is displayed as such in the browser. When I print it, it appears as half of a portrait page. If I use Print Preview I can change to landscape but I don't want to have to remember to do this.

Sample file - http://services.land.vic.goc.au/pdfjs/map1.pdf
Screen grab - http://services.land.vic.goc.au/pdfjs/map1.jpg

@timvandermeij
Copy link
Contributor

@ce03 The links are dead. Could you post new ones?

Is this still an issue with the latest viewer at http://mozilla.github.io/pdf.js/web/viewer.html?

@ce03
Copy link
Author

ce03 commented Jan 28, 2014

Tim

I made a mistake with the previous links .goc. should be .gov.

Sample pdf
http://services.land.vic.gov.au/pdfjs/map1.pdf

Displayed in browser

http://services.land.vic.gov.au/pdfjs/map1_displayed_as_landscape_in_browser.jpg

Displayed in FinePrint printer manager, and sending direct to printer
gives the same result

http://services.land.vic.gov.au/pdfjs/map1_sent_to_printer_as_portrait.jpg

The problem still exists in PDFJS.version = '0.8.649'

Regards,
Chris Egan

Chris Egan | Information Integration | Information Services Division
Corporate Services | Department of Environment and Primary Industries
Level 13, 570 Bourke Street, Melbourne, Victoria 3000
T: 03 8636 2322 | E: [email protected]
www.depi.vic.gov.au

From: Tim van der Meij [email protected]
To: "mozilla/pdf.js" [email protected],
Cc: ce03 [email protected]
Date: 27/01/2014 03:18 AM
Subject: Re: [pdf.js] printing not correct for landscape (#2851)

@ce03 The links are dead. Could you post new ones?
Is this still an issue with the latest viewer at
http://mozilla.github.io/pdf.js/web/viewer.html?

Reply to this email directly or view it on GitHub.

Notice:

This email and any attachments may contain information that is personal,
confidential, legally privileged and/or copyright. No part of it should be
reproduced, adapted or communicated without the prior written consent of the
copyright owner.

It is the responsibility of the recipient to check for and remove viruses.

If you have received this email in error, please notify the sender by return
email, delete it from your system and destroy any copies. You are not authorised
to use, communicate or rely on the information contained in this email.

Please consider the environment before printing this email.

@silentsakky
Copy link

Does anyone have any fix for this issue?

@ousia
Copy link

ousia commented Aug 27, 2017

Acrobat has an orientation parameter in the printing dialog that can be set to auto, such as in:

not this

Image linked from Adobe and it has another property selected.

Maybe it would be helpful that PDF.js implements page auto-orientation as default.

@jscher2000
Copy link

jscher2000 commented Jul 29, 2019

Could something like this help in adapting to the unknown orientation the browser will use:

@media print and (orientation: portrait) {
  /* Rotate page if it is landscape */
}
@media print and (orientation: landscape) {
  /* Rotate page if it is portrait */
}

Perhaps there should be a preference to turn that off for people who prefer to control the orientation themselves.

@stbear
Copy link

stbear commented Feb 29, 2020

I've changed the following lines of code:
return pagesOverview.map(function (size) { if (isFirstPagePortrait === (0, _ui_utils.isPortraitOrientation)(size)) { return size; }
to
return pagesOverview.map(function (size, index) { if ((index == 0 && isFirstPagePortrait || index > 0 && (0, _ui_utils.isPortraitOrientation)(size))) { return size; }
and it works fine for me. Didn't test it much, since our app with embedded PDF.js will be deployed to end users in fall.

@timvandermeij
Copy link
Contributor

Closing since this is fixed by the PR above.

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

No branches or pull requests

6 participants