[reportlab-users] Allow commenting on a pdf

Robin Becker robin at reportlab.com
Fri Dec 4 11:59:34 EST 2009


Gabe Black wrote:

> I'm fairly new to reportlab, and looking at the documentation and source,

> it appears that the default encryption is None. I am using platypus

> to generate a pdf (no encryption) and it is all working fine.

> What I would like to do is to allow the user to make comments on the

> pdf and save those comments. Although I have never done that, when

> comparing file formats, one of the features listed that helped me make

> the decision to use the pdf format was the ability to comment on its

> contents.

>

> Anyway, I open up the generated pdf in adobe reader and select

> File->Properties->Security. The commenting attribute is listed as

> "Not Allowed" Maybe this is a limitation of adobe reader, but I

> thought I should be able to "comment" the pdf?

>

> Any suggestions would be appreciated.

> Thank you,

> Gabe

........
there is a way to get an encryption dictionary onto a reportlab document.

The code looks like this

from reportlab.lib.pdfencrypt import encryptCanvas
encryptCanvas(canvas,userPassword='uuuuu',ownerPassword='ooooo',
canPrint=1, canModify=1, canCopy=1, canAnnotate=1,
strength=40)


alternatively you can use an EncryptionFlowable from the same file in a platypus
story. I haven't tested any of this recently so you may find some bugs.
--
Robin Becker


More information about the reportlab-users mailing list