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

Prints white pages in Firefox #7515

Closed
tryggve opened this issue Aug 1, 2016 · 4 comments
Closed

Prints white pages in Firefox #7515

tryggve opened this issue Aug 1, 2016 · 4 comments

Comments

@tryggve
Copy link

tryggve commented Aug 1, 2016

We have built our own viewer upon the pdf.js library and I have experienced some issues regarding to print. Our viewer displays one or two pdf-pages based on the ratio of the window. Resize your browser window until you see a spread of the newspaper. For some reason the Firefox print functionallity doesn't like it when you resize the window so you may need to reload the page if the browser shows you a dialog saying something unexpected went wrong. But when you have the spread and try to print the pages the output is white pages. If you resize the window until only one page is visible (and then reload the page because Firefox breaks) the pdf get's printed but it get's cut at the bottom for some reason. Safari and Chrome is able to print the spread as well as a single page alright. I use the mozPrintCallback-shim from the pdfjs-viewer for those browsers.

Each page in the newspaper is a separate pdf document and I load the pages using the same worker. I have used the same pattern as in the pdfjs-viewer for setting up and rendering to a new canvas in a printContainer and using that for the print output.

I think the bug occurs during the render of the canvases when the mozPrintCallback method is invoked. If I put in some logs it seems that both canvases get's their mosPrintCallback method added to them but only one of them is invoked. I tried to use the polyfill in Firefox as well but that ended up in four white pages instead of two so that didn't seem to be the right way to go.

1 screen
1 result
2 screen
2 result

Configuration:

  • Web browser and its version: Firefox 47.0.1
  • Operating system and its version: OSX El Capitan 10.11.6
  • PDF.js version: 1.3.62#084bb86 (also tried the latest 1.5)
  • Is an extension: No

Steps to reproduce the problem:

  1. Press the print-button in the GUI or cmd-p on your keyboard while viewing a spread.
  2. Print or preview the pages.

What is the expected behavior?
Should print or preview the pdf-pages

What went wrong?
Prints or previews white pages

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): http://webapp.im-epaper.se/pdfjs/print-bug/#pages/10902/3/24

@pixelbits-mk
Copy link

@tryggve Do you have a sample PDF and can you reproduce the issue with the non-customized pdf.js viewer?

@tryggve
Copy link
Author

tryggve commented Aug 10, 2016

I can not create the same scenario with the official viewer since it only loads one pdfDocument and our viewer loads two (or several) pdfDocuments. That is the main difference in the viewer. However I think the bug is in the pdf.js library as it handles the render requests that seems to fail in this case.

@yurydelendik
Copy link
Contributor

Is it still an issue?

@timvandermeij
Copy link
Contributor

timvandermeij commented Oct 9, 2016

Closing as fixed after recent printing PRs. To reopen (if the problem remains with current master branch), please provide a new example based on that branch. Note that loading more than one PDF document per page is experimental and may not work correctly (see e.g., #7693).

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

No branches or pull requests

4 participants