One possibility: having the script automatically:
- Take the web page
- Open that page in a web browser
- Take a screencap of that page
- Turn it into a PDF
step 4 is easy - there are plenty of PHP/cmdline libraries that will let you put images onto a pdf or convert them (eg, fpdf.)
For steps 1-3... you might could try looking at the code from here: http://browsershots.org/. Not sure if it would be relevant - it seems like it requires a lot of setup. Maybe their architecture could work?