Archive for September, 2009

Add encryption for Zend_Pdf

September 21, 2009

Over the weekend, I have ported the encryption code from FPDF_Protection ( to Zend_Pdf. I can’t extend the code from Zend_Pdf to add this feature, so I have tweak a code file : Zend_Pdf_ElementFactory. I feel a little guilty on that :D.


  • When conduct testing, I see that we can’t create un-attached page. Attached page always works.
  • As a port from FPDF_Protection, it only allows encryption with 40 bits length and permissions : print, modify, copy, annot-forms.
  • FPDF_Protection doesn’t take document Id to build encryption key so it resets document id to empty. So does this library.



Hope that this little library is helpful for you guys. It’s my first contribution to zend framework community after a long time of using it so I am over exited to see your feedback.

Download from google code.