Force print dialog in mobile Safari for multi page PDF

JavascriptIosPdfMobilePrintjs

Javascript 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:

  1. Navigate to the PDF file you wish to save. Make sure you are in the PDF viewer.
  2. Tap the share icon (it's a square with rounded edges, with an arrow coming out of the top).
  3. Scroll down past Messages and the trays where you can send the file to an app. Find and tap on "Print."
  4. 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).
  5. Click "Print" and the document will be printed by your printer.

Solution 3 - Javascript

If you want to print full pdf from safari

  1. Single tap in pdf.
  2. You can see More and Open in "Ibooks" link top of the page. (If you are not see, just scroll down a bit and tap again.)
  3. Click More link, after that you can see a pop-up .
  4. In pop-up you can see a print Button, Click that.
  5. Select copy and range.

Solution 4 - Javascript

Instead of trying to print in mobile Safari, you can export to iBooks and print from there.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPaul Vincent BeigangView Question on Stackoverflow
Solution 1 - JavascriptPaul Vincent BeigangView Answer on Stackoverflow
Solution 2 - JavascriptJackson_ITGuy12View Answer on Stackoverflow
Solution 3 - JavascriptEmranView Answer on Stackoverflow
Solution 4 - JavascriptAefixView Answer on Stackoverflow