audiobookshelf icon indicating copy to clipboard operation
audiobookshelf copied to clipboard

[Bug]: PDF Reader is flickering

Open vincentscode opened this issue 1 year ago • 11 comments

Describe the issue

The PDF reader flickers on each page change, which makes using it rather uncomfortable. The page number also flickers and the green loading bar is rather distracting.

chrome_snkqSByONM

This does not seem necessary since the page is rendered, then white, then rendered again. Is the first render lower resolution? Would it be possible to not render a white "frame" in between (and remove the loading bar) to make it less jaring?

Steps to reproduce the issue

  1. Open a PDF ebook
  2. Flip through pages

Audiobookshelf version

v2.5.0

How are you running audiobookshelf?

Docker

vincentscode avatar Nov 02 '23 20:11 vincentscode

This might be entirely due to the PDF Viewer Library used which appears to be rather unmaintained. Perhaps switching to something like https://github.com/TaTo30/VuePDF might resolve the issue.

vincentscode avatar Nov 03 '23 12:11 vincentscode

Thanks, the codebase isn't using Vue3 yet

advplyr avatar Nov 03 '23 12:11 advplyr

I see, I should have checked. Are there any plans to migrate to Vue 3 as Vue 2 seems to reach its EOL?

vincentscode avatar Nov 03 '23 12:11 vincentscode

Yeah but there is no rush to migrate before the EOL. I want to migrate mostly so we can handle subfolder path support for reverse proxies.

advplyr avatar Nov 03 '23 12:11 advplyr

I see, makes sense. For Vue 2 https://www.npmjs.com/package/pdfvuer looks rather compelling (demo) and has a similar programming interface to what is currently used, though a feature to only show a single page at a time does not seem available.

vincentscode avatar Nov 03 '23 12:11 vincentscode

After testing it out for a bit, it seems like pdfvuer would basically be a drop-in replacement without any of the issues. I can create a pull request, however my CSS / styling knowledge is quite limited, so somebody else might need to have a look at that afterwards.

vincentscode avatar Nov 10 '23 16:11 vincentscode

What's the current status on this issue? I am experimenting this bug a lot myself.

Would love to contribute for this issue to be fixed ❤️

DownloadableFox avatar Feb 22 '24 23:02 DownloadableFox

The linked PR is functional. Feel free to test it out and improve upon it, if you notice something that could be better!

vincentscode avatar Feb 23 '24 07:02 vincentscode

I am on 2.8.1 installed on Debian 12. Mine doesn't flicker, but after a few pages, the page turned dark and the turn pages become unresponsive. image

kabaga avatar Apr 03 '24 02:04 kabaga

The flickering is fixed now so I don't think the other PDF reader library is necessary at this time.

advplyr avatar May 31 '24 21:05 advplyr

Sounds good to me. The landscape of Vue 2 PDF libraries is rather abandoned as a whole unfortunately.

vincentscode avatar Jun 01 '24 04:06 vincentscode

Fixed in v2.11.0

advplyr avatar Jul 09 '24 20:07 advplyr