BookBrowser icon indicating copy to clipboard operation
BookBrowser copied to clipboard

[Error] PDF cover cannot be shown

Open seuplus opened this issue 6 years ago • 11 comments

Platform: Debian GNU/Linux 8.10 (jessie)

1、[error] PDF cover cannot be shown correctly. See the Picture1 below. 2、[enhancement] Can you add a go-back-to-cover button on epub browser. See the Picture2 below.

Thank you!

Picture1 pdf-cover-error

Picture2 screen shot 2018-01-06 at 19 22 40 1 1

seuplus avatar Jan 06 '18 11:01 seuplus

For the pdf cover, currently there is no way to extract it (there are no libraries written in go) short of writing a whole pdf rendering library (which would take a lot of work) or calling an external command (which will greatly decrease the indexing speed, and will not work on all systems). If I find a PDF library written in go, I will add covers.

For your second issue, it actually belongs in http://github.com/geek1011/ePubViewer/issues . You can view the cover by pressing the info button in the top left, or you can go to it in the table of contents. As for clicking the book title, may I ask why this would be useful?

pgaskin avatar Jan 06 '18 15:01 pgaskin

Thank you!

seuplus avatar Jan 07 '18 10:01 seuplus

Hi, @geek1011, is it possible to use the basic pdf reader implementation like https://github.com/rsc/pdf which lacks of rendering part, or https://github.com/yob/pdfreader which can convert pdf to svg. Or, is it possible to use front-end pdf reader to do this? It's very helpful for the pdf books.

LiMinggang avatar Dec 25 '18 02:12 LiMinggang

Maybe. I need to look into this more.

pgaskin avatar Dec 27 '18 15:12 pgaskin

Please make high priority to issue #47 which is a big performance improvement for huge books like mine. I don't think the projects I listed are mature enough for use. And I think I will try a workaround for the thumbnail issue of PDF, ie, use ghost script to generate thumbnails for BookBrowser. Anyway, the books should not update too often.

LiMinggang avatar Dec 28 '18 03:12 LiMinggang

Yep. I was thinking of something like that. I'll probably make it call imagemagick if it is present.

As for #47, I'm working on it when I have time. I've figured out how to do an efficient checksum of the epub without reading the whole thing, and now, I just need to figure out how I'm going to store metadata in a forwards compatible way.

pgaskin avatar Dec 29 '18 03:12 pgaskin

Thanks for your hard work! FYI http://duncanlock.net/blog/2013/11/18/how-to-create-thumbnails-for-pdfs-with-imagemagick-on-linux/ https://stackoverflow.com/questions/26383405/ghostscript-command-create-thumbnail-images-from-pdf-file

LiMinggang avatar Dec 30 '18 00:12 LiMinggang

Another candidate in go https://github.com/hhrutter/pdfcpu

LiMinggang avatar Jan 03 '19 02:01 LiMinggang

@LiMinggang That looks almost perfect! I'll see how it works later this week.

pgaskin avatar Jan 03 '19 17:01 pgaskin

There is another JS version which supports PDF thumbnail. No idea if it's OK for us. https://github.com/oguzhaninan/Buka

LiMinggang avatar Jan 04 '19 03:01 LiMinggang

No, that won't work. It uses PDF.js to render it. Last time I tried, I couldn't get it running in otto (a js runtime for go).

pgaskin avatar Jan 04 '19 14:01 pgaskin