Using PHP to Add Dynamic data to existing PDF

Hello all,

Is there a way in PHP where you can add some data to a field(or is it textbox?) within an existing PDF document? I great example is the ebooks sitepoint sells. When you buy an ebook they add your email address at the bottom of every page within the PDF ebook. Looking at the software they use it seems to be some hugely priced Java server side app that it is in the $1000.00s…

Cheers

Marc

One quick and easy solution is to build a PDF, that is not encrypted/compressed, have simple placeholders such as %$YOUR_EMAIL$% and str_replace() those with the textual value of your choice.

When complete, you could probably run a PDF compression/encryption routine to tighten things up.

just a thought, not sure how practical that would be, but I recall doing something very similar when I first got into PHP some 10 years ago, so I am sure something like this is possible.

Cheers,
Alex

Hey thanks I will take a look :slight_smile:

You could take a look at http://www.setasign.de/products/pdf-php-solutions/fpdi/