Reputation: 901
When clicking on PDF links in a webapp, user should be taken to PDF viewer page from where
Should I be using a browsers builtin PDF viewer for this purpose?
What are the advantages of pdf.js over the built-in browser PDF viewer?
More importantly, do suggest ways to integrate my webapp with Chromes builtin PDF viewer and also on how to satisy above 2 conditions?
Upvotes: 0
Views: 2716
Reputation: 1222
As to the question about benefits of using pdf.js over any bulit in pdf viewers:
PDF.js works on almost all well known web as well as smartphone browsers. Here is the list of the currently supported browsers. Thus compared to what you are trying to do right now(i.e., trying to figure out only for chrome) using pdf.js will widen your scope of users and the browsers they can use for your product.
Printing functionality is already present in pdf.js so that already solves your first requirement.
As to your second need that is to prevent downloading of a pdf. Here(the last comment in the link by ztraboo) where you will find which lines to comment out and what downloading code to be deleted from pdf.js source code so as to remove the download button and the code facilitating the same.
Finally a quick tutorial to getting started with pdf.js is here. Just use your actual server instead of the localhost there.
Upvotes: 3
Reputation: 2878
PDF.js is the client-side javascript script that provides the following advantages over native plugins:
So saying about your question you should better go with PDF.js so you may implement deep integration with your code and the viewer. But with pdf plugin you are not able to access its elements, UI etc except the limited API it provides.
Upvotes: 1