PHP and PDF file manipulation

I need some help with PDF’s and PHP…A client first approached me waning the ability for a site visitor to select pages of a website and save them as a single PDF file. I was able to accomplish this relatively easily using sessions and dompdf.

Now I have a new wrinkle. I need a user to be able to choose from a list of existing PDF files on the server and merge them into a single PDF file for download. dompdf doesn’t appear to have this merge/concatenating feature.

I’ve seem reference to pdftk for accomplishing this, but can’t for the life of me understand how to incorporate that with PHP…can anyone help with this problem? Either with pdftk or some other way?

Thanks in advance,
rvt