One of my customers has an insane amount of PDF and Microsoft Word DOC files on their website. It’s core to their online services so it’s not as though they’re garbage files up on the server. My customer wanted their website’s search engine (Sphider) to read these PDF files and DOC files so that their clients could get at the documents they needed without going through a bunch of summary pages to get them. I was successful in the task, so let me show you how to read PDF and DOC files using PHP.
PHP Archives
Read PDF and Word DOC Files Using PHP

Create an Is.Gd URL Using PHP
Is.Gd is a URL-shortening service much like TinyURL. Using PHP’s cURL library, you can create shortened URLs on the fly with ease.
The PHP
//gets the data from a URL
function get_isgd_url($url)
{
//get content
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$content = curl_exec($ch);
curl_close($ch);
//return the data
return $content;
}
//uage
$new_url = get_isgd_url('http://davidwalsh.name/php-imdb-information-grabber');
“is.gd” is much shorter than “tinyurl.com” so if you need the URL to be as short as possible, use this method.

Create Tiny URLs with TinyURL, MooTools, and PHP
Since we’ve already figured out how to create TinyURL URLs remotely using PHP, we may as well create a small Ajax-enabled tiny URL creator. Using MooTools to do so is almost too easy.
The XHTML (Form)
<p><strong>URL:</strong> <input type="text" id="url" size="40" /> <input type="button" id="geturl" value="Get URL" /></p> <p id="newurl"></p>
We need an input box where the user will enter their a URL, a button to trigger the process, and a placeholder to put the new, tiny URL.
Feeds & Profiles
Sponsors
Advertise with DavidWalsh.Name
Site Search
Discussion Topics
Script & Style
Return of the Mobile Style Sheet
Google Tells Users to Drop IE6
Create an Amazing Music Player using Mouse Gestures & Hotkeys in jQuery
5 Tips to Make Your Headers More User Friendly
Comment Form Design
Mike Davidson on ESPN.com Redesign
How to Make a Descriptive Menu Using CSS Lists
Easy Image or Content Slider (jQuery plugin)
The Perfect Document Overlay
The Best CSS Design of 2008








