Print.js: Print multi page Pdf in mobile Safari

Created on 24 Apr 2017  路  10Comments  路  Source: crabbly/Print.js

In mobile Safari (I am testing on iOS 10.3.1) only the first page of a multi page Pdf gets printed.

Any idea how to fix this?

help wanted

Most helpful comment

Ran into exactly the same issue, would be great if someone could find a solution for this one.
I also notice that PDF's (single page and multi-page) are scaled down a bit in size. (e.g. text that should be at the bottom of the page, is printed at about 3/4 of the page)

And, should it help you finding a solution: The URL of the page I'm currently on is printed at the bottom of the page (not the URL of the PDF I'm printing), along with the page number.

All 10 comments

Not really. I would have to run a test. Have you tried to print the pdf directly without using the library?

@crabbly here is the print screen when I directly open http://printjs.crabbly.com/docs/large_printjs.pdf and use native iOS print option - 3 pages:

image

and here of I print the same Pdf via print.js - 1 page:

image

That's a new one. Somehow Safari mobile is not rendering the pdf properly when loaded with the library. I'll take a look into this.

Ran into exactly the same issue, would be great if someone could find a solution for this one.
I also notice that PDF's (single page and multi-page) are scaled down a bit in size. (e.g. text that should be at the bottom of the page, is printed at about 3/4 of the page)

And, should it help you finding a solution: The URL of the page I'm currently on is printed at the bottom of the page (not the URL of the PDF I'm printing), along with the page number.

This is still an issue with safari mobile.
I think we should just identify the browser as "not supported" and force the pdf to be opened by IOS.

Thoughts?

Closing this in favor of #33. Keeping all browser compatibility issues under that ticket.

It seems like the iOS Safari print method takes the first page of the PDF, and handles it as if it were an HTML page, with the following behaviors:

  • A blank PDF is created, independent of the PDF you're trying to print.
  • The first page of the your PDF is added to the blank PDF as an inline image (incl. downsampling)
  • Footers containing the page URL and the printing timestamp are added.
  • The system PDF is passed to the printer stack.

This appears to be a Safari behavior for web-based printing, so there's nothing this library can do to work around it.

@crabbly
I have just encountered this error that you can only print the first page of multi-page PDFs. As you have closed this issue with #33 - should this one be resolved or is iOS Safari just not supported?
I was not sure, therefore I checked the large-pdf-sample on your website, but the same bug here...
Would be great, if you could give me a short hint. Thx!

That's correct. Safari mobile is currently not supported, unfortunately. We should update the browser support table on the documentation page, with mobile browsers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

galcott picture galcott  路  7Comments

JahsonKim picture JahsonKim  路  5Comments

r3wt picture r3wt  路  8Comments

xtornasol512 picture xtornasol512  路  8Comments

zhuyinjing picture zhuyinjing  路  7Comments