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

Printing is broken on iOS #83

Closed
stephanrauh opened this issue May 30, 2019 · 16 comments
Closed

Printing is broken on iOS #83

stephanrauh opened this issue May 30, 2019 · 16 comments
Assignees
Labels
bug Something isn't working Solved Version 13 Scheduled for version 13 waiting for the user's answer

Comments

@stephanrauh
Copy link
Owner

stephanrauh commented May 30, 2019

Reported at StackOverflow by Scott Garret.

Steps to reproduce: open the demo on an iPad and click the "print" button. The preview dialog opens, showing nothing but a single blank page.

The discussion on Mozilla's GitHub has several suggestions how to solve the bug: mozilla/pdf.js#7597

@stephanrauh
Copy link
Owner Author

Nobody has upvoted this ticket for a long time, so I believe nobody uses the PDF viewer to print on an iOS device. Hence I'm closing this ticket now.

@digaus
Copy link

digaus commented Jan 28, 2022

Nobody has upvoted this ticket for a long time, so I believe nobody uses the PDF viewer to print on an iOS device. Hence I'm closing this ticket now.

I am using it on Android and iOS, both showing only blank pages :/

@stephanrauh stephanrauh reopened this Jan 28, 2022
@stephanrauh
Copy link
Owner Author

Oh - not that nasty bug again! I've spent countless evenings trying to figure out what's going on.

On the other hand, I've learned a lot about pdf.js in the meantime, so I'm ready to have a look at it again. I can't promise you to solve the bug. But I can promise to try.

@stephanrauh stephanrauh added considering it Maybe I'll implement this, maybe not. I haven't made up my mind yet. It's an interesting proposal! and removed wontfix This will not be worked on labels Jan 28, 2022
@kisimediaDE
Copy link

Upvote for print on iOS - I want to integrate this in an Ionic App

@stuartpaulin
Copy link

Same here, I'm very grateful for this tool, currently viewing using it and it is working on iphone in an ionic app, but download and printer button missing - think it is a cors issue... bit confused.. I'm a junior dev in that respect!

@mt-webdev
Copy link

mt-webdev commented Jun 17, 2022

@stuartpaulin For us (Capacitor app) the download button is working, you could take another look at your code probably :)

@stephanrauh would you be open to a PR? You mentioned you already dived into pdf.js, not sure if I could help out, but could try.

@stephanrauh
Copy link
Owner Author

@mt-webdev Of course I'm open to pull requests!

stephanrauh added a commit to stephanrauh/pdf.js that referenced this issue Jun 17, 2022
…nting on iOS (otherwise it prints the website or blank pages instead of the PDF file)
stephanrauh added a commit that referenced this issue Jun 17, 2022
…he website or blank pages instead of the PDF file)
stephanrauh added a commit to stephanrauh/pdf.js that referenced this issue Jun 17, 2022
…nting on iOS (otherwise it prints the website or blank pages instead of the PDF file)
@stephanrauh
Copy link
Owner Author

I've read the discussion of mozilla/pdf.js#7597 again and added a timeout specifically for iOS. It seems to work. The only problem is I don't have any clue what's going on - and to my experience, that's a bad when fixing bugs.

Be that as it may, please try version 13.5.3 and tell me if it solves the bug on your devices, too.

@stephanrauh stephanrauh added waiting for the user's answer Solved and removed considering it Maybe I'll implement this, maybe not. I haven't made up my mind yet. It's an interesting proposal! labels Jun 17, 2022
@stephanrauh stephanrauh self-assigned this Jun 17, 2022
@stephanrauh stephanrauh added the Version 13 Scheduled for version 13 label Jun 17, 2022
@stephanrauh
Copy link
Owner Author

I didn't hear from you for two weeks, so I assume my bugfix works on your machine, too.

@digaus
Copy link

digaus commented Jul 2, 2022

Was in vacation for two weeks so did not test it yet 🙈

@stephanrauh
Copy link
Owner Author

Enjoy your vacations - or the week-end if it's already over! Closing tickets is basically a matter of house-keeping. It feels better to have to short list. :) But I'm still listening to this channel, just add your insight as a new comment.

@mt-webdev
Copy link

mt-webdev commented Jul 4, 2022

I will take a look in the upcoming week (have also been on vacation 😅). Looking forward to it!

@ghost
Copy link

ghost commented Nov 18, 2022

Hi guys, I have tested the ipad printing and found the printout contains the pdf.js header toolbar, and some contents on the right are missing. Please refer to below attached file. Could anyone have the same experience and how to solve this problem?
Any suggestion is appreciated! Thank you!

test Ipad priting

@stephanrauh
Copy link
Owner Author

@can2000ca What did you print, precisely? Your printout indicates you've been using Mozilla's showcase, so I'm not responsible. Nonetheless, I can try to give you some pointers.

How did you print, precisely? I suppose if you hit the print button of the browser, it prints the page as-is. So it's not astonishing that the toolbar is there.

However, if you're using the print button of the PDF viewer's toolbar, a lot of magic happens. Basically, your entire page is hidden in print mode. Instead, the page shows a couple of images specifically added during printing. Hiding the page and showing the images instead requires some CSS rules which are frequently overwritten by CSS frameworks. Please check your CSS rules. I've collected some of the more common traps here: https://pdfviewer.net/extended-pdf-viewer/troubleshooting

@ghost
Copy link

ghost commented Nov 19, 2022

@stephanrauh Thanks for your comments.

I used the print button of the PDF viewer's toolbar.

Here is what I did:
open this link from iPad Safari:
https://mozilla.github.io/pdf.js/web/viewer.html
Open any PDF file
Print (use the print button of the PDF viewer's toolbar.)

@stephanrauh
Copy link
Owner Author

stephanrauh commented Nov 19, 2022

@can2000ca I see. I've managed to reproduce the bug. It's interesting that Safari prints the file correctly on the Laptop, but fails to do so on the tablet.

The pdf.js team have ceased to support Safari. That's why Jonas closed your bug ticket yesterday. They had too much trouble on a topic they consider a byplay. ngx-extended-pdf-viewer inherits most of the code from pdf.js, so I'm very reluctant fixing their bugs. My bugfix tends to get lost or broken with the next update of pdf.js.

If you find out which CSS rules are missing, I can add the vendor-specific prefixes again in my fork of the PDF viewer. Generally speaking, printing on iOS has always been unreliable, but it's new that it doesn't work altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Solved Version 13 Scheduled for version 13 waiting for the user's answer
Projects
None yet
Development

No branches or pull requests

5 participants