advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
5.78k stars 393 forks source link

[Bug]: PDF Reader is flickering #2279

Closed vincentscode closed 2 days ago

vincentscode commented 8 months ago

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 commented 8 months ago

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.

advplyr commented 8 months ago

Thanks, the codebase isn't using Vue3 yet

vincentscode commented 8 months ago

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

advplyr commented 8 months ago

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.

vincentscode commented 8 months ago

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 commented 8 months ago

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.

DownloadableFox commented 4 months ago

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 ❤️

vincentscode commented 4 months ago

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

kabaga commented 3 months ago

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

advplyr commented 1 month ago

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

vincentscode commented 1 month ago

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

advplyr commented 2 days ago

Fixed in v2.11.0