-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Problem with PDF background image in Macbook pro retina screen (Chrome) #8837
Comments
I cannot reproduce that on MBP with FF or Safari with default retina display using default viewer. What browser you are using? Can you publish complete example online? (You have the complete code -- I have to spend time to re-type and re-build code from snippets) |
The browser used by me is in the issue description, and title. 🐙 |
Missed that somehow. Marking as such. |
That's version |
Yes, now I'm also on Version 60.0.3112.113 (Official Build) (64-bit). Chrome updates are really quick. |
I was not able to reproduce with demo viewer. (Last picture was for SVG backend.)
@Huespal do you still has problem with new chrome version? |
Yes. I still have the same problem with the new chrome version. |
A quick update. I'm getting the:
warning message. I wonder if a good worker configuration can solve the issue. The way I'm setting up the worker is like wojtekmaj said on 13 Jul in this issue: Especially because the workerSrc path (I can not put an static string pointing to the worker file like the official example in my project environment). Is there some way to debug pdf worker errors? I will update the issue if I get worker configured. EDIT: |
Just in case someone is suffering the same issue. I 'solve it' by rendering again only in the first PDF render: From the code above is called onPageRender, so:
I don't like it. So I still want to solve the issue in a correct way. EDIT: |
@Huespal the snippet above is not part PDF.js library code -- please contact the vendor of the component directly. The #7612 looks like connected with some custom library as well. Here is my sandbox for playing with pdfjs, webpack and react if you want to change a base library and start using pdf.js directly: https://github.com/yurydelendik/pdfjs-react |
Yes, you are right. That damn component vendor (me :))
for this:
I don't remember why I code it. Thanks for pointing to the sandbox. I saw it before, but dismissed because not in angular. |
mmm he is asking about current angular (>2.x), different from this issue's angular (1.x). But I can try it this weekend. |
Thank you. Having a minimal Angular example in https://github.com/mozilla/pdf.js/tree/master/examples would probably help out quite a bit of people. I think we should aim for Angular > 2.x since that's simply more modern, but having an AngularJS example (1.x) would already be better than nothing. People could probably alter it for usage in Angular > 2.x anyway. |
Link to PDF file (or attach file here):
Dropbox 'Getting Started.pdf' PDF -> https://www.dropbox.com/s/zwfzuaampxim8bi/Getting%20Started.pdf?dl=0
Configuration:
The project is using Angular 1.x JS Framework.
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
A well perfectly scaled blue Dropbox box in background image. Like in the real life.
What went wrong? (add screenshot)
Bad scaled background Dropbox box image. Background is rendered as if CSS styles or canvas width, height are not applying, is my first idea. But I don't know exactly. It fails only in this configuration. Works in FF in all OS. Works in Chrome both in ubuntu and windows. Works in Mac in another screen. I can only reproduce the bug in the Macbook pro default retina display. Which is important because the target of people using Macbook pro screen and chrome is huge.
Canvas dimensions I'm applying:
The best part:
It just happens every first time PDF is rendered in page load. Page 1 is first rendered, and fails. If I go to the next PDF page, 2, page renders ok. Going going back to the page 1, now is ok. Same exact function is called for every page:
Thanks
The text was updated successfully, but these errors were encountered: