# Generate pdf file with password protected

**URL:** <https://www.ruby-forum.com/t/generate-pdf-file-with-password-protected/162651>\
**Category:** Ruby\
**Created:** [March 12, 2009, 1:16pm UTC](https://www.ruby-forum.com/t/generate-pdf-file-with-password-protected/162651 "2009-03-12T13:16:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jprabu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jprabu](https://www.ruby-forum.com/u/jprabu)\
**Post date:** [March 12, 2009, 1:16pm UTC](https://www.ruby-forum.com/t/generate-pdf-file-with-password-protected/162651/1 "2009-03-12T13:16:09Z")

</div>

Hi,

I have small requirement to generate the pdf files with password  
protected. For that I have created pdf file using FPDF library. but i am  
unable to create a pdf  
file with password protected.

kindly help me.

Regards,

Prabu J

---

<div class="post-metadata">

**Author:** ![jprabu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jprabu](https://www.ruby-forum.com/u/jprabu)\
**Post date:** [March 12, 2009, 3:00pm UTC](https://www.ruby-forum.com/t/generate-pdf-file-with-password-protected/162651/2 "2009-03-12T15:00:40Z")

</div>

On Thu, Mar 12, 2009 at 8:14 AM, Prabu J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,
> 
> I have small requirement to generate the pdf files with password  
> protected. For that I have created pdf file using FPDF library. but i am  
> unable to create a pdf  
> file with password protected.

You should really consider using Prawn instead of FPDF, even though it  
also does not support this feature.

I am still waiting for someone to create a prawn-crypt (or  
prawn-secure) extension, but so far all people do is ask for this  
feature rather than work on it. It’s not a need of mine.

-greg

---

<div class="post-metadata">

**Author:** ![jprabu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jprabu](https://www.ruby-forum.com/u/jprabu)\
**Post date:** [March 12, 2009, 3:14pm UTC](https://www.ruby-forum.com/t/generate-pdf-file-with-password-protected/162651/3 "2009-03-12T15:14:11Z")

</div>

> but i am unable to create a pdf file with password protected.

If everything else fails, you could run pdftk over the pdf on disk.
