[Hopefully you can follow my instructions. I find these things much easier to do myself than to explain, but I'll try to lay everything out step by step for you.]
You really should install your own custom PHP in order to use PDFlib, and thanks to the Dreamhost wiki, doing that is pretty simple. It's mostly copy and paste.
Follow the easy instructions they give, using the first installation script which is linked to. Change line 4 to have your domain name, making sure it's the same domain name as listed in your home directory. For example, if your domain is listed as DOMAIN.COM instead of WWW.DOMAIN.COM, make sure you use DOMAIN.COM on line 4. Execute the script from your home directory, not from your domain directory.
It's going to take a while to build, so go find something interesting to do while you're waiting. If you log in with another SSH session, now would be a good time to go ahead and follow the instructions in the same wiki entry about modifying your .htaccess file. Otherwise don't forget to do that when it's done.
After your screen settles down and PHP is done, confirm that under the domain you installed to you see a cgi-bin folder with the file php.cgi inside. If not, you probably made a typo on line 4 of your install script. In that case, go back to your home directory and look for a new folder with your mistyped domainname. Copy the cgi-bin to your domain directory and make sure you copy the php.cgi that's in it as well.
Back in your home directory again, do the following:
tar -xvvzf PDFlib-7.0.0p3-Linux-php.tar.gz
Now, go to your domain's cgi-bin directory and do this:
cp ../../PDFlib-7.0.0p3-Linux-php/bind/php5/php-520/libpdf_php.so ./
Now copy your php.ini to cgi-bin:
cp ../../php5/etc/php5/DomainNameYouUsedInLine4/php.ini ./
Now edit php.ini. I usually use pico just because that's what I'm used to.
Ctrl-W to find extension_dir
Make sure extension_dir = "./"
Now, add a line:
Ctrl-O to Save
Ctrl-X to Exit
Now... you're done! To make sure everything worked, put the following script into a test file:
<?php phpinfo(); ?>
Save it to something like test.php, then load it up in your web browser. If it worked, you should be able to scroll down and see:
PDF Support enabled
PDFlib GmbH Binary-Version 7.0.0p3
PECL Version 2.1.0
Revision $Revision: 1.5 $
Any questions or problems, e-mail me at email@example.com.