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

Safari: only one try to print #9578

Closed
hand-coding opened this issue Mar 18, 2018 · 4 comments
Closed

Safari: only one try to print #9578

hand-coding opened this issue Mar 18, 2018 · 4 comments
Labels

Comments

@hand-coding
Copy link

Attach (recommended) or Link to PDF file here:
http://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf
This problem occurs with every documents I tested.

Configuration:

  • Web browser and its version: Safari 11.0.3 and Safari Preview r51
  • Operating system and its version: macOS 10.13.3
  • PDF.js version: 2.5.3
  • Is a browser extension: No

Steps to reproduce the problem:

  1. Visit the pdf.js live demo at http://mozilla.github.io/pdf.js/web/viewer.html
  2. Click the “print“ icon (or command+P)
  3. Wait for the modal dialog to show then click “Cancel”
  4. Click the “print“ icon again (or command+P)

What is the expected behavior?
The Print window should show a preview for the first page and I should be able to browse all of the 14 pages thumbnails like the first time I tried.

pdf-js-report-1

What went wrong?
A modal window appears reading: This web page ask to be printed. Do you want to proceed?
Cancel - Print

pdf-js-report-2

Clicking Print shows a one page empty preview

pdf-js-report-3

All subsequent tries will fail the same way until the user reload the page.

@hand-coding
Copy link
Author

That seems to be a Safari printing issue which occurs also with other js library. I’m not sure anybody should spend any time on it.
I decided to implement the “nativePrint” method used by pdf-highlighter.com and described here: https://pdf-highlighter.com/pdfjs-printing-issue-use-browser-support/.
Works well in Safari, Opera, Chrome and Windows Edge.
IExplorer (without plug-in) will use pdf.js print method (as well as Firefox, unfortunately, since FF sees the iframe content as cross-origin, even if it's not, and thus forbid printing).

@tohvanah
Copy link

tohvanah commented Dec 8, 2018

@hand-coding How can the native printing in a child iFrame be accomplished with a base64 data URL?

@hand-coding
Copy link
Author

Please start a new thread.

@timvandermeij
Copy link
Contributor

Closing since this is fixed by #12315.

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

3 participants