As anyone who has tried knows, using optical character recognition on pdf files can be confusing, especially since Tesseract, repeatedly hailed as the best free ocr software, can only do *tif files. This method isn't really that hard, it just converts everything to the proper format automatically.
Step 1: Install needed packages
Code:
sudo apt-get install tesseract-ocr tesseract-ocr-eng xpdf-reader xpdf imagemagick xpdf-utils
Side Note: You will need to install language packages for tesseract for every other language you wish to use. For example, package tesseract-ocr-fra allows you to ocr the french language. Check synaptic package manager
Step 2: See if you actually need ocr
xpdf-utils (which you just installed) provides a pdftotext utility:
Code:
pdftotext "Name of PDF file"
If it works, congratulations and don't move on 
Step 3: OCR'd
The following shell script will attempt to ocr your file. I suggest placing it somewhere in your $PATH so you can run it from the same directory as the pdf file and not have weird filenames.
NOTE: This program works by converting each page of the PDF file into a 100MB TIFF image. That means a temporary 100MB increase of hard drive usage per page in your pdf while the program is running. If it's an issue, this can be decreased/changed by editing the shell script - either decrease the quality number in pdftoppm or make it do only a few pages at a time - check man pdftoppm
Code:
#!/bin/sh
mkdir tmp
file=$1
cp ${file} tmp
cd tmp
pdftoppm * -f 1 -l 10 -r 600 ocrbook
for i in *.ppm; do convert "$i" "`basename "$i" .ppm`.tif"; done
for i in *.tif; do tesseract "$i" "`basename "$i" .tif`" -l eng; done
for i in *.txt; do cat $i >> ${file}.txt; echo "[pagebreak]" >> ${file}.txt; done
mv ${file}.txt ../${2}
rm *
cd ..
rmdir tmp
Usage:
1) Copy the script into gedit or your favorite text editing program and save it.
2)
Code:
cd /path/to/saved/file/
chmod +x filename
3) Run the script: If it is saved in your $PATH, just type the filename in the console, followed by the name of the file you wish to ocr. Otherwise, you have to cd to the /path/to/saved/file and
Code:
./filename "Name of PDF File" "Name of Output File"