Print Page | Close Window

Password to Open File

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3097
Printed Date: 02 May 24 at 8:59AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Password to Open File
Posted By: Supertension
Subject: Password to Open File
Date Posted: 29 Mar 15 at 3:02PM
Hi,
 
I'm using version 8.16.
 
I have several hundred files that I want to password protect.  I use the following to set the password that a user is required to enter to make changes to a file's contents and it works fine. 
 
Perms = QP.EncodePermissions(1, 0, 0, 0, 0, 0, 0, 1) 'Set permissions
retval = QP.LoadFromFile(MyFileName, NullString)
retval = QP.Encrypt("mypassword", NullString, 1, Perms)
QP.SaveToFile (MyFileName)
 
My question is how can I use some similar coding to set the password that a user is required to enter to actually open a file?
 
Many thanks.
 
 



Replies:
Posted By: Ingo
Date Posted: 30 Mar 15 at 7:25AM
Hi,
 
you wanna set a user Password.
It's the same syntax:
http://www.debenu.com/docs/pdf_library_reference/Encrypt.php" rel="nofollow - http://www.debenu.com/docs/pdf_library_reference/Encrypt.php
retval = QP.Encrypt("myownerpassword", "myuserpassword", 1, Perms)
 
Cheers,
Ingo
 


-------------
Cheers,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk