You are probably going to need to use a library that would add pdf editing capabilities.
Just do a google search for "edit pdf from php page" and you will find a few options out there. Once you can add content to a pdf file in general, adding it from your details page should be no problem.