view PDFs in Browser-builtin PDF viewer

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
rmu
Posts: 2
Joined: Mon Oct 01, 2018 10:50 am

view PDFs in Browser-builtin PDF viewer

Post by rmu » Wed Apr 10, 2019 5:29 pm

Is it possible to view PDF documents in firefox' pdf.js? (without explicitly "downloading")

This would be very useful vor large-ish documents, reading a reference manual with 1500 pages via server-rendered pictures doesn't make much sense IMHO.

User avatar
rosarior
Posts: 274
Joined: Tue Aug 21, 2018 3:28 am

Re: view PDFs in Browser-builtin PDF viewer

Post by rosarior » Sun May 19, 2019 8:06 pm

It would be possible but would defeat Mayan's purpose which is to also be a server-side document viewer. Clients or browsers connecting that are unable to execute pdf.js would not be able to view the files. Would also add much code to the client side and only benefits PDF files, which is just one of the many files types Mayan support. Could be added, but not worth the work and consequences in terms of file size, adding more dependencies, slowness and new JavaScript issues with users from all the different browsers in the market, not to mention API users. Since pdf.js requires the document to be downloaded from the server anyway, you are better off using the operating system's PDF viewer for large PDF files.

rmu
Posts: 2
Joined: Mon Oct 01, 2018 10:50 am

Re: view PDFs in Browser-builtin PDF viewer

Post by rmu » Fri May 24, 2019 10:31 am

Modern Browsers have PDF viewing functionality baked in, so no real dependency would be needed. Also there is the acrobat reader browser plugin. I don't know if it is possible to detect that from javascript.

Additional complexity: it should amount to a user preference setting ("use browser internal PDF viewer") and a different viewing template.

If you have some hints where I could look/start I could give it a try.

Post Reply