使用rails生成受密码保护的pdf

时间:2022-04-21 21:15:02

Recently I was looking for some gem which can password protect our existing pdf files.

最近我在寻找一些可以密码保护现有pdf文件的gem。

Basically we are fetching some invoice PDFS from aws . After fetching it from aws , we have to add password to the pdf and send it as an attachment in an email.

基本上我们从aws获取一些发票PDFS。从aws中获取后,我们必须为pdf添加密码并将其作为附件发送到电子邮件中。

I tried with prawn/hexapdf/combined_pdf , but no success. Because with prawn i can not find a way to read an existing pdf. but prawn can easily password encrypt any pdf generated via prawn.

我尝试使用prawn / hexapdf / combined_pdf,但没有成功。因为对虾我无法找到一种方法来阅读现有的pdf。但是大虾可以很容易地密码加密通过虾生成的任何pdf。

Any suggestion would be greatly appriciated.

任何建议都会受到极大的关注。

1 个解决方案

#1


0  

Not really a gem, but is it possible to install and use a command line program like pdftk? I've been using it for years for similar problems with great success.

不是真正的宝石,但是可以安装和使用像pdftk这样的命令行程序吗?多年来我一直在使用它来解决类似的问题并取得巨大成功。

#1


0  

Not really a gem, but is it possible to install and use a command line program like pdftk? I've been using it for years for similar problems with great success.

不是真正的宝石,但是可以安装和使用像pdftk这样的命令行程序吗?多年来我一直在使用它来解决类似的问题并取得巨大成功。