I have a very simple pure html file in which I have many PDF files. I have link it like this:
<a href="pdffile.pdf"> PDF 1 here </a>
When I click the link, the PDF file is downaloaded and viewed in the native Reader program. I want it to open in another window of the browser, and read it there, rather then saving a copy manually to my computer and opening it.
Making a PDF non-downloadable is as simple as adding #toolbar=0 to the URL.
Unless you host your own PDF viewer on your website such that the PDF file itself is not internally downloaded by whatever PDF reader the user has on their computer (i.e., your website displays a raster bitmap of the PDF content), there is absolutely no way to prevent the file from being downloaded and shared using ...
Find the file you want to share in OneDrive or SharePoint, and select the circle in the upper corner. Select Share at the top of the page. Select Anyone with the link can edit to open Link settings. Uncheck Allow editing, and then turn on Block download.
Chrome > Settings > Privacy & Security > Site Settings > Additional Content Settings > PDF Documents > UNCHECK Download PDF files instead of automatically opening them in Chrome.
Almost all modern browsers have built-in PDF viewers. You can directly link to the PDF file and the browser will view it. You can also use an <iframe>
if you want to view it inside an HTML page (e.g. with your website headers, etc.).
Another approach, but more complicated and not necessary except for very special circumstances, is to convert the PDF files to HTML (as described in #1 of the 2012 answer below).
Viewing the PDF file in the browser (without download) requires an add-on to the client's browser. Google Chrome, for example, has a built-in PDF viewer and can open files directly, while IE and Firefox require that you install a plug-in (the one that comes with Adobe Reader).
There are two other approaches:
Convert the file to HTML, image, or any other format that can be directly viewed in the browser. This conversion can be on-the-fly using a server-side (written in PHP, Python, ASP, whatever language), or you can just pre-convert all files to a readable one.
The other approach, which is the best, is to use a Flash-based PDF viewer (such as http://flexpaper.devaldi.com/). This is easy, flexible and doesn't require writing server-side code. This approach is used by many Document-sharing sites (e.g. http://www.scribd.com/, http://www.slideshare.net/, http://www.docstoc.com/)
Mozilla created the PDF.js library. It displays pdf files in a web page without an external reader or plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With