I am looking for a PDF viewer which must have the following features
Open source
Free
Web Based
PHP/MySQL web-application supportive.
caching facility
I have already seen flexpaper, do-pdf, sumatra pdf and many others but those doesn't fulfill my above criteria
So I guess you want to show your PDF's stored on your file system without using the user's default PDF viewer? Just open it with a php viewer class (e.g. http://www.phpclasses.org/package/6464-PHP-Alter-a-PDF-document-to-make-it-print-when-opened.html). It complies with 1,2,3 and 4. No.5 is up to your programming.
Related
I'm developing a new website with PHP & MySQL.
The website is for an online eBook library that grant access to its books based on paid subscription plans.
So, I need to make sure the PDF files of these books are well protected and can't be saved, downloaded, or in anyway copied.
How can I do that?
I suggest you to convert the PDF into an image , and display the first page or as you like, check this library it can be useful
Imagemagick
I think this is not a PHP or MYSQL solution. PDF's have a "protected mode". There you can disable printing the pdf. You should look for a server side pdf recreation tool that can recreate the pdf in protected mode and serve the user this file. Take a deeper look into PDF functions. I think i can remember that there should also a trial mode also and the ability to view only on 1 device.
Here a link for more info: http://www.dummies.com/software/adobe/acrobat/restrict-who-can-edit-or-print-pdf-documents/
You'll be able lock down the files from unwanted downloads. But redistribution or sharing login details will be a battle.
Some options I can think of
Option 1:
You can handle this yourself on the server. Housing the PDFs outside of the public Apache directory (so there is no way a URL can reach it). Then with a PHP function read the contents of the file and stream it to the browser.
Streaming a large file using PHP
Option 2:
Use something like AWS S3. You can lock down the bucket so there is no public access. And generate signed URLs as needed. They'll be unique urls which you can specify a time limit of availablity. AWS S3 The security of a signed URL as a hyperlink
I currently run a Linux server, but would switch to Windows if needed.
Users will upload documents in .DOC, .DOCX or .PDF format. I want to convert the MS Word docs to PDF. Then, later, when a user loads a page which I am coding with AngularJs, the page should fetch the document from my server and embed it.
I don't want to rely on 3rd party web services, such as Google, as these are liable to change, but don't mind a 3rd party PHP library for the conversion, or maybe a "print to PDF" option, but I don't have MS Word on my server (I suppose that I could do so if I switch to windows (or use Open Office on Linux?)). Preferably free, certainly sub $100.
If fetching the doc via AJAX to the AngularJs page is problematic, I suppose that I could generate the page with the embedded PDF in PHP on the server.
I don't even know how best to go about it. Google is not my friend, the only solutions I can see for my case recommend the Google DOCs API, which is now deprecated.
I hope to here from someone who has already implemented this.
Doing some research on trying to secure documents on a server so that visitors cannot copy paste the content.
Users can upload documents as pdf, doc, docx, and currently they can download these files in staging enviroment. Anyone know of a way I could either upload these as read only so once they are downloaded they cannot be edited or copy pasted etc?
Or is there a way I could get the contents of these files and display the content on a webpage while disabling copy paste etc?
Just looking for some ideas on a solution for this.
You cannot control web browser behavior.
The only way to do that is to use a script to render a part of a document.
For example, rendering page by page in a web view. But user could copy/past content even if you deploy some Javascript.
Perhaps, you should take a look to Flash, Silverlight or Java applet.
I think there are few solutions that can limit access to read only.
But il will mainly limited to computers.
You can protect a file with a password too.
Files could be downloaded but only users owning the password could edit them.
This is the case for PDF files, Excel files, etc.
It's a way but I don't think it's the best way.
I think the easiest way is to convert your documents as PDF files and to limit actions to read only by adding a password. You ll be able to disable write permission, print permission, etc. And rendering a PDF on a web page is very simple.
I am currently tasked to make a website that allows a personnel of people to select possible candidates for a job.
From here, the candidate will upload their resume online to the PHP server. After which, the candidate will view the resume for review to see whether is the candidate suits for the job. I would like to know how is it possible to allow them to download the document from the server and/or view the documents online, probably in another browser page.
Thank you! :)
I would like to know how is it possible to allow them to download the document from the server and/or view the documents online, probably in another browser page.
After a file was moved from the temporary upload folder to your "uploads" folder, you are able to generate a download link to the file.
The file can be view "online", when the viewer opens the file in a new browser tab (by right-clicking the download link, then open in new tab) or you set target="_blank" on the link.
Most modern browsers have PDF support. I would only suggest to utilize a document viewer on server side, if the download links must be protected and the user-group is rather small, because this doesn't scale well.
I need to open pdf file into browser without Adobe Reader. Is there any API with php which open PDF files into browser.
Regards
No.
PHP runs on the server. The only "browser API" it has access to is HTTP.
If you want to render a PDF on the client, then the client needs a PDF renderer. There are JavaScript PDF readers, but I can't comment on their cross-browser support or maturity.
You can use SWFTools to convert PDFs to Flash. But SWFTools default skins are not looking good at all, so you can check Flexpaper as a viewer.
In case you are going to make your own skin, then could be useful to read: SWFTools (pdf2swf) to properly work with Flex
Another solution is pdf.js (as Quentin point out), but AFAIR this script was not usable(back then, when I looked for) for PDFs with complex structures (complex gradients for example).
If you need to publish documents as "private" you should look at services as Issuu or you will have to protect files from downloading.
If you pdf files are put online and not restricted, you can try using Google Doc Viewer. It's a very nice way to put the Viewer in <iframe /> so that it can be combined with your web page.
https://docs.google.com/viewer
It is not feasible to view the PDF files without a viewer like Adobe Reader. If you just don't want to use Adobe Reader, you may try a PDF viewer plug in for web browser from some other company.
However, if you do not want to use a viewer at all and want to write/build your own viewer then a better option is to convert the PDF to scalable images and then show them on the web page using image tags. You can also create such a viewer using JavaScript.
Even you can find many already available JavaScript based viewers which can show those images.