mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.62k stars 10k forks source link

IOS printing with viewer in overlay prints main (unfocused) window with overlay #12779

Closed kaytuca closed 3 years ago

kaytuca commented 3 years ago

Attach (recommended) or Link to PDF file #here:

Configuration:

Steps to reproduce the problem:

  1. Open a pdf with the Viewer in a greybox modal overlay (http://www.teleplay.nl/webdevelopment/labs/galleryplay/greybox/installation.html) on an iPad or iPhone. 2.Use the print button in the Viewer.
  2. The Print dialog box shows both the overlay and the underlying page in a somewhat jumbled manner.
  3. Printed output prints BOTH the overlay AND the underlying page and places the overlay in the body of the underlying page.

What is the expected behavior? (add screenshot) The expected behavior is to only show the Viewer window and not the underlying page when the print button is pressed in the Viewer. Printing from the Viewer in the greybox modal overlay works as expected in both Chrome and Firefox in a desktop environment running Win10.. The print dialog box renders as expected and the printed output is as expected. https://github.com/kaytuca/pdfjs/blob/main/pdfjs%20Win10%20Chrome%20Prints%20Correctly%20in%20Overlay.JPG

What went wrong? (add screenshot) https://github.com/kaytuca/pdfjs/blob/main/Ipad%20Print%20Issue.png

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

Notes:

  1. The Viewer renders a pdfin the greybox modal overlay (using the ES5 Viewer) without a problem on iPhone, iPad, and Win10 desktop in Chrome (all devices) and Firefox (desktop).
  2. The problem occurs only when the Viewer's "print" button is used and the print dialog box is called (on the two iOS devices I tried).
Snuffleupagus commented 3 years ago

Web browser and its version: iPad 6th Gen using Chrome App,; iPhone 6Plus using Chrome App [...] Printing from the Viewer in the greybox modal overlay works as expected in both Chrome and Firefox in a desktop environment running Win10.

This suggests a bug in the platform/browser itself, rather than the in the PDF.js library, since otherwise you'd expect it to be consistently broken everywhere; as such it's unfortunately quite difficult to see that this is an actionable issue here.

Furthermore, please also keep in mind that the web-platform in general has quite limited printing support.