Page 1 of 1
How to read pdf document & display its content in browser??
Posted: Mon May 10, 2010 2:23 am
by nmreddy
Hi ,
In my application a user will upload pdf documents , i have to read that pdf file and display the content in the pdf to the browser .
how can i do that
can any one suggest me the solution ??
Thanks,
Maheedhar
Re: How to read pdf document & display its content in browse
Posted: Mon May 10, 2010 6:23 am
by nmreddy
Can any one have a solutions??
Re: How to read pdf document & display its content in browse
Posted: Mon May 10, 2010 8:27 am
by mikosiko
browsers normally have pdf plugins installed (or you can install it) to display pdf's files directly... no much to "invent" here
Re: How to read pdf document & display its content in browse
Posted: Mon May 10, 2010 10:53 am
by xtiano77
I normally use a tag like the one below to ensure that the file opens in a separate window.
<a href="yourfile.pdf" target="_blank">Your File</a>
If you want to view the file in the same window where the link is just changed the "target" property to "_top". You can always use the "open( )" JavaScript function which will normally open the file on its own window. Just my two cents.
Re: How to read pdf document & display its content in browse
Posted: Mon May 10, 2010 10:41 pm
by nmreddy
First Thanks for the suggestions,
but what i want is , when a user upload the pdf file i have to read the contents of pdf and display its contents in the webpage like we read text files and display its contents..
Re: How to read pdf document & display its content in browse
Posted: Tue May 11, 2010 1:40 am
by cpetercarter
It is not easy to do what you want. There are several php/pdf libraries (eg
FPDF) but they all create pdf documents using php - they don't read pdf documents and turn them into html which you can then send to the browser as part of a web page.
This post suggests one way of reading a pdf file into a php variable, but you need root access to your server to do it.
This post explains a more practical approach to reading the "clean text" from a pdf document, which may do most of what you need.
php is not working on wamp
Posted: Tue May 11, 2010 3:05 pm
by brishable
0 vote down star
i have installed wamp server but php is not working.
i wrote a simple php code to display something on a browser
and stored it on c:\wamp\www\bre nothing is displayed on the browser.
i have tested the c:\wamp\index.php file but the browser starts downloading it instead of
opening the page.
and i have tested to connect html forms with the mysql database and still the
php part don't do anything. my operating system is xp.
i'm really worried can anybody help me?
Re: How to read pdf document & display its content in browse
Posted: Tue May 11, 2010 3:54 pm
by mikosiko
brishable wrote:0 vote down star
i have installed wamp server but php is not working.
i wrote a simple php code to display something on a browser
and stored it on c:\wamp\www\bre nothing is displayed on the browser.
i have tested the c:\wamp\index.php file but the browser starts downloading it instead of
opening the page.
and i have tested to connect html forms with the mysql database and still the
php part don't do anything. my operating system is xp.
i'm really worried can anybody help me?
and why are you posting a new issue in somebody else thread?... that it is not polite/good etiquette ... please read the forum rules and how to post your how thread.
Re: How to read pdf document & display its content in browse
Posted: Fri May 14, 2010 5:01 am
by nmreddy
@cpetercarter -- thanks for the valuable suggestions , presently i am getting the text but it was like a one string
ex:this would be giving as thiswouldbe