-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Default viewer doesn't use 'retina' toolbar icons on iOS #6685
Comments
Safari on desktop affected as well, the following shall be fine for our preprocessor:
|
I'm wondering if any progress has been made on this one. I am implementing pdfjs for clients who exclusively use tablets and mobile devices, and many comment that the icons are "blurry." On a desktop with a high-resolution display, the issue is not as critical as the icons are much smaller relative to the view area. But on a mobile device, it is odd. |
Nope. Any ideas why safari is doing it? |
Isn't the issue that no one has created high-resolution assets to be served to the browser? I'm also wondering why the desktop viewer always displays a sans-serif font while iOS uses what looks like Times Roman! |
Are these need to be in Safari specific format? WFM on Firefox and Chrome. Also text looks good as well. |
I'm using Safari mobile on iOS devices. I don't have access to an android phone rn to check, but I assumed the assets simply weren't large enough to display properly. |
Every image has an |
Thank you @timvandermeij for this information. I'm not sure how to troubleshoot this, but can report that I've viewed many builds of pdfjs over the past 3 years on a broad array of iOS devices -- iPhones and iPads of all stripes. In every case, the wrong assets were served, and the wrong font was used. |
It looks like the problem is that Safari only supports the |
Did you try the suggestion from #6685 (comment), since that seems like a good starting point? |
I can confirm that the solution suggested does work, on Safari and iOS. All that needs to be changed is this line in viewer.css:
to
This can be seen working here: http://www.thing.gallery/test/pdf.js/web/viewer.html Now if we can figure out #9392, pdfjs will start looking a lot better on iPhones and iPads. |
@timvandermeij, it seems the solution I have posted above completely resolves this issue. I am not exactly sure how to create a PR for this, but was wondering if one of the devs might be able to create the PR given it is only 2 lines of code. I tried just now but I don't think I have the permissions. |
this is a big +1 from me too |
Closing since this is fixed by #9629. |
When using the default viewer provided with PDF.js on iOS (retina), the toolbar icons appear blurry.
This seems to be because the following media query in viewer.css isn't being matched:
@media screen and (min-resolution: 2dppx)
Changing this to include a webkit-specific prefix seems to solve this:
@media screen and (min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 2)
(My CSS knowledge isn't great, so apologies if there are problems with this)
I realise that users are expected to build upon the default viewer, but it would be nice if this worked out of the box.
(Tested using iOS 9.1 Safari & UIWebview)
The text was updated successfully, but these errors were encountered: