-
Notifications
You must be signed in to change notification settings - Fork 37
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
fix: prevent pdf flickering #355
base: main
Are you sure you want to change the base?
Conversation
|
I can still see the flicker, what you removed was actually an attempt at removing the flicker (that failed). |
aah okay! could it be related to the pdfjs version maybe? we're currently 2 major versions behind it seems 😅 |
In the pdfjs examples they use a rendering queue, see |
Yeah I think that would be wise to update 😅
This looks like the proper implementation of my attempt |
updating didn't change much, it still goes like page 1 => blank page for a flash => page 2 => blank page for a flash => page 3, it's weird |
The example in react-pdf also flickers 😆 |
Ohhh indeed ahah🤦 ! |
This code also has the same issue. I think that the minted pdf files on teia are more "image" type than "text", so rendering them is always harder on the browser than just ASCII :/ |
objkt.com uses https://www.npmjs.com/package/ng2-pdf-viewer which works very well, but I suppose there's no way to make that work on react? //edit: without using iframes (because that would be easy I think, like we do for previews with iframe.teia.art) |
https://vadimdez.github.io/ng2-pdf-viewer/ this is snappy 😄 just put an ipfs link as source and uncheck "show all pages" |
Angular is widely different not sure how we could do that sanely tbh. |
we might have updated deps in main since
bruh
Will merge tomorrow if no one see objections. @Zir0h just migrated the iframe thing we removed a few months back to it's own repo -> https://github.com/teia-community/teia-iframe The idea proposed by Z0 would be to add support for pdf there so that we can use whatever work best |
Possible fix for #220
Looks like the page is rendered twice when doing next/previous, this causes it to jump around on the UI