NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: sukhendu on April 18, 2013, 10:42:01 AM
-
Trying to password protect PDF report. Assigning a password on the Report to PDF extension template works. But I would like to put a variable by putting an exclamation (!) sign before the variable name. The program compiles fine. However the password value assigned on the embed point before the Self.Encryption does not work.
Any help here is appreciated.
Thanks Sukhendu
-
I've not done this myself, but what code are you using to set the password variable?
Is the password variable used at any point in the procedure before that?
Cheers
Bruce
-
Bruce,
I define a local variable lcl:password (string(100)). Enter !lcl:password on the Report to PDF extension template. And then assign lcl:password = 'blabla123' on embed point as follow:
lcl:password = 'blabla123' !assign password here for testing the embed point
SELF.SetFileName(loc:PDFName)
SELF.SetDocumentInfo('CW Report','PDFCPCS','Rpt_DailySummary','Rpt_DailySummary','','')
SELF.SetPagesAsParentBookmark(False)
SELF.CompressText = True
SELF.CompressImages = True
SELF.SetEncryption(lcl:password,PDFAccess:Print+PDFAccess:Copy+PDFAccess:ModifyContent+PDFAccess:ModifyAnnotations)
However, this works.
SELF.SetEncryption('blabla123',PDFAccess:Print+PDFAccess:Copy+PDFAccess:ModifyContent+PDFAccess:ModifyAnnotations)
I'm using c8.9304 NTalk 6.40
Thanks - Sukhendu
-
Hi Sukhendu,
maybe it needs to be of the form
! clip(lcl:password)
so it generates
SELF.SetEncryption(clip(lcl:password),PDFAccess:Print+PDFAccess:Copy+PDFAccess:ModifyContent+PDFAccess:ModifyAnnotations)
I don't know though if their template will allow that? But it's the only difference I can see.
cheers
Bruce
-
Hi Bruce,
!clip(loc:password) worked. Very insightful solution! Thank you.
Can the password on the PDF file be made non readable while typing? I did not see any option for this on the "Report to PDF" extension template.
Cheers,
Sukhendu
-
no idea - sorry. I guess ask the PDF people....