Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make PDF viewer in PHP

Tags:

php

pdf

I want to open PDF file with PHP. Don't want to use Flash. Like google doc viewer. I just want to open PDF file. Can I do with PHP ?

like image 903
saturngod Avatar asked Jan 08 '10 04:01

saturngod


People also ask

Can PHP be used to display PDF?

PHP uses a standard code to display the pdf file in web browser. The process of displaying pdf involves location of the PDF file on the server and it uses various types of headers to define content composition in form of type, Disposition, Transfer-Encoding etc. PHP passes the PDF files to read it on the browser.

How can I open PDF file without downloading in PHP?

Under "Privacy and security," click Content settings. Near the bottom, click PDF documents. Turn off Download PDF files instead of automatically opening them in Chrome.

How do I display a PDF on my website?

Generally, a hyperlink is used to link a PDF document to display in the browser. An HTML anchor link is the easiest way to display a PDF file. But if you want to display a PDF document on the web page, PDF file needs to be embedded in HTML. The HTML <embed> tag is the best option to embed PDF document on the web page.


2 Answers

PHP cannot natively open and display a PDF file to the browser. In most cases you want to just send the file to the browser and allow the Adobe Reader to open and display the file. However, if you are looking to pull data out of the PDF itself, then the PDF function built-into PHP may be of some help.

http://php.net/manual/en/book.pdf.php

like image 90
TehDrew Avatar answered Nov 08 '22 00:11

TehDrew


You can't BUT You can make one with PHP

making a previews of each page like google reader

this links may help you How do I convert a PDF document to a preview image in PHP?

like image 45
ucefkh Avatar answered Nov 07 '22 23:11

ucefkh