seblucas / cops

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
http://blog.slucas.fr/en/oss/calibre-opds-php-server
GNU General Public License v2.0
1.43k stars 229 forks source link

Use pdf.js to read the pdf directly in the browser #284

Open dhtek opened 8 years ago

dhtek commented 8 years ago

It could be great to integrate pdf.js https://github.com/mozilla/pdf.js/wiki/Setup-pdf.js-in-a-website to read the pdf in the browser without loading it and save it locally.

Thanks for your job !

seblucas commented 8 years ago

I mainly use Firefox so it works as is. I won't do it myself but clean PR are welcome

dhtek commented 8 years ago

I'm using Firefox too but I have the popup to download or open the file when I click on the pdf button. untitled

Firefox is configured to preview the pdf directly untitled1

Do you have a idea ?

seblucas commented 8 years ago

Yes you can try to change this line :

https://github.com/seblucas/cops/blob/master/fetch.php#L114

And remove attachment; it should work better. I have this hack uncommited for a while, I think it was a problem with some OPDS reader but I don't remember clearly.

seblucas commented 8 years ago

@dhtek

Did you test my suggestion ?