1

What I'd like to do

I'd like to allow a user to download a dynamically generated pdf file (certificate). I was thinking of creating a pdf template and just write the user's name on it with PHP, that's the only thing that will be dynamic about this.

How I'd like to do it

Since the application is for a client and I have no idea on what server will he use it I'd like to know if there are ways of achieving this without any extra extensions or whatsoever to be installed on the server. I can assume he has PHP > 5. Basically read the template pdf and write a string to it then save it to be able to offer for download, all this with PHP?

slash197
  • 9,028
  • 6
  • 41
  • 70

1 Answers1

0

doing this with pure php on your own will get very messy, so i recommend using FPDF in combination with FPDI (to open your templates). both can easily be added to your projects sources, so you don't need to install any extensions (unless you want to compress your PDFs - in that case you'll need zlib installed).

oezi
  • 51,017
  • 10
  • 98
  • 115
  • By compression you mean creating an zip/rar archive to download or something like an mp3 file has? – slash197 Mar 30 '12 at 06:57
  • 1
    it's more like the mp3-case: a pdf can be compressed "internally", so you can use/open it like an uncompessed one. it's not like puttin it into an archive that has to be unpacked before using. it's not a neccessary feature (unless bandwith is important for you), but nice to have. – oezi Mar 30 '12 at 08:00
  • you're welcome. if this solved your problem, please consider accepting it by clicking the gray tick-mark to the left of it. – oezi Mar 30 '12 at 09:55