[reportlab-users] Encryption in pdf

Andrea Cappelli a.cappelli at gmail.com
Fri Sep 11 03:01:56 EDT 2009


Hi list,
yesterday I tried to create an encrypted pdf, as stated in paragraph 4
of readme.pdf, but it doesn't work me regarding the options like
canPrint, canCopy, etc.

The output is encrypted and requires a password to be opened (unless i
specifies only the ownerPassword, in this case as stated no password for
opening is required) but I can print and copy from the document

I'm usign reportlab 2.3 on Ubuntu 9.04 (python 2.6 ) and the following
piece of code:

from reportlab.pdfgen import canvas
from reportlab.lib import pdfencrypt
enc=pdfencrypt.StandardEncryption("","owner_pass",canPrint=0,canCopy=0)
def hello(c):
c.drawString(100,100,"Frase di test che non dovrebbe essere
copiata")
c = canvas.Canvas("test.pdf",encrypt=enc)
hello(c)
c.showPage()
c.save()

I'm wrong using this feature or it is not entirely implemented?

Thanks



More information about the reportlab-users mailing list