Force print dialog in mobile Safari for multi page PDF
JavascriptIosPdfMobilePrintjsJavascript Problem Overview
How to force a working print dialog for a multi page (printing the first page is working) PDF in mobile Safari?
Side info: If I "long tap" the PDF in mobile Safari I get a "Save image as" dialogue. Maybe the mobile Safari implementation renders the PDF as image and I should search for a solution that this engine renders multiple pages?!
Javascript Solutions
Solution 1 - Javascript
I would rather say it is a real answer but an alternative if there is no support to force a working print dialogue for a multi page PDF in mobile Safari:
If the source for generating a PDF is HTML, you can use the HTML inside the page and print that instead of the PDF. This will work for more than one page, also in mobile Safari.
Solution 2 - Javascript
As of iOS 13, this is fixed. I thought I should leave this here in case anyone else stumbles across this link.
Here's how you can print a PDF file from Safari:
- Navigate to the PDF file you wish to save. Make sure you are in the PDF viewer.
- Tap the share icon (it's a square with rounded edges, with an arrow coming out of the top).
- Scroll down past Messages and the trays where you can send the file to an app. Find and tap on "Print."
- Once you tap Print, you can select the printer, how many copies, which pages will be printed, and some options (single/double-sided, color/black and white).
- Click "Print" and the document will be printed by your printer.
Solution 3 - Javascript
If you want to print full pdf from safari
Single tap
in pdf.- You can see
More
andOpen in "Ibooks"
link top of the page. (If you are not see, just scroll down a bit and tap again.) - Click
More
link, after that you can see a pop-up . - In pop-up you can see a print Button, Click that.
- Select copy and range.
Solution 4 - Javascript
Instead of trying to print in mobile Safari, you can export to iBooks and print from there.