PDF protection on-the-fly

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I've been wrestling around with finding a way of password-protecting  
existing PDF documents with custom passwords, all on-the-fly, using PHP.

I've found some commercial implementations of doing this, but was  
looking for something without a price tag attached to it. :)

I came across the FPDF library, but that only creates PDFs, not modify  
existing ones.  Further searching around revealed FPDI, a couple of  
classes that can read existing PDFs and modify them.  However that  
didn't give me the security features I was looking for.

Finally, I came across another class, FPDF_Protection, which DOES apply  
password-protection as well as encryption for creating PDF documents..  
The problem is that there isn't any easy way to marry the two together..  
  FPDI uses some of its own custom classes (ie FPDI_tpl 'templates'),  
and FPDF_Protection is just extended from the FPDF class.

I'm thinking of mashing the two classes together somehow  
(FPDF_Protection and FPDI), but if there's  an easier way around it....  :)

Has anyone had experience doing this sort of thing? (Password-protecting  
existing PDFs on-the-fly)  If so, what was your solution?


Re: PDF protection on-the-fly

ezpdf (http://www.ros.co.nz/pdf /)


Re: PDF protection on-the-fly


first be informed that FPDI do not modify any existing documents. It'll
"only" give the posibility to use single pages of an existing document
as a kind of template. The resulting document is a completely new
created document.

Some weeks ago I've adapted the FPDF_Protection class to
FPDI_Protection for use with FPDI. You can find it also on the project
homepage of fpdi: http://fpdi.setasign.de in the download section (at
the bottom (-; )

If you want real/direct (and also faster (-;) encryption of existing
documents with up to 128bit we also offer commercial PHP-APIs for PDF
processing. But for sure there's a price attached to it... ;-) You can
see the API here:

If you're interrested in, don't hesitate to contact me.



sorry to my poor english, i'm spanish

I want to open a pdf protected file that I know its password for write
in a header in all pages using FPDI .. How I can open a pdf

thank for all

http://eye.cc -php- web design

Re: FPDI_protection

trufito schrieb:

Quoted text here. Click to load it

Doesn't make sense at all... FPDI does NOT modify any PDF! So you'll
never get the possibility to ADD any Content to a pdf with FPDI. So
your currently protected PDF will never be seen by anyone... why did
you protect it? :-) Just use an unprotected PDF as source file and
protect the resulting one with FPDI_Protection.


Site Timeline