Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file_get_contents() returns garble!

Status
Not open for further replies.

jwoods7

Technical User
Feb 19, 2003
36
US
I'm using:
$results = file_get_contents("email_notebook.pdf");
echo $results;
in an attempt to return just the text portion of the pdf file and save it to a variable. I've looked around but can't find an easy function, and this only returns "??«Ú?¢=¶º£sMWwÏÚÞuØ°qÓæ-" type of info...


My goal is to output either a string or an array of the text found in a pdf file...
Any suggestions?
 
A couple of things.

First, finding text inside a PDF is not very straightforward. The text isn't stored in a directly-human-readable form in the file and as such requires the use of some fairly complicated software to perform the extraction. For example, on Linux one would typically invoke an app called ghostscript which can take a PDF and output it to different formats.

Second, are the first 4 characters of your output "%PDF"? If so, your PHP code is working correctly.


Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top