Print Page | Close Window

Locking created pdf

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=746
Printed Date: 17 May 24 at 1:04PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Locking created pdf
Posted By: perry
Subject: Locking created pdf
Date Posted: 18 Jun 07 at 2:16PM
Does anyone know of any way to 'lock' the created pdf so that it cannot be updated by quickpdf, acrobat or any other software.  I have a feeling that there is something in Acrobat SDK but can't find anything in iSed QiickPdf



Replies:
Posted By: bogey
Date Posted: 18 Jun 07 at 2:36PM
This is how I do it in VBScript:
 
 
function secureForm(thisDoc)
 call QP.SelectDocument(thisDoc)
  fncDebug("<br><b><i>Securing Form</i></b>")
  '===========================================
  'Set Document Information
  '===========================================
  'QP.SetInformation(0) = ""   'PDF Version
  call QP.SetInformation(1,"Union Central")  'Author
  call QP.SetInformation(2,"")  'Title
  call QP.SetInformation(3,"")  'Subject
  call QP.SetInformation(4,"")  'KeyWords
  call QP.SetInformation(5,"Union Central")  'Creator
  call QP.SetInformation(6,Request.ServerVariables("SERVER_NAME"))  'Producer

  '===========================================
  'Lock each PDF file prior to delivery
  '===========================================
  'Default Permissions
  permissions = "10011011"
  'for 40 bit encryption
   '1.canPrint (ALLOW Printing )
   '2.canCopy  (ALLOW content copying or extraction, content accessibility enabled)
   '3.canChange (ALLOW Changing the document, Form Fill-in & signing, Document Assembly)
   '4.canAddNotes (ALLOW Authoring Comments and Form Fields, Form Field Fill-in & Signing)
  'for 128 bit encryption (not used, only compatible with Acrobat 5 and up)
   '5.canFillFields YES,
   '6.canCopyAccess NO,
   '7.canAssemble YES,
   '8.canPrintFull YES
  fncDebug("<br>Setting Form Permissions = " & permissions)
  'Permissions - canPrint, canCopy, canChange, canAddNotes, canFillFields, canCopyAccess, canAssemble, canPrintFull
  permissions=QP.Permissions(returnbln(permissions,1), returnbln(permissions,2), returnbln(permissions,3), returnbln(permissions,4), returnbln(permissions,5), returnbln(permissions,6), returnbln(permissions,7), returnbln(permissions,8))

  'encrypt 40 bit for compatibility with acrobat 3 and 4
  call QP.Encrypt(PDFPassword,"",0,permissions)
 secureForm = QP.SelectedDocument
end function



Posted By: perry
Date Posted: 28 Jun 07 at 4:18AM
Hi Bogey
thanks for this excellent example. 
 
Having disabled 'change,copy' etc, does this enable me to distribute the document so that they can view it without knowing any password but prevent them from editing it with any PDF software?
thanks.


Posted By: Ingo
Date Posted: 28 Jun 07 at 4:35AM
Hi Perry!

Yes. Using only the main password protects your settings but the reader doesn't need a password to read the document.
If the user shall insert a password before reading you have to set the user password, too.

Keep in mind that there are tools out there for removing the main password from pdf-documents... It's not really safe. A user password is much safer ... but uncomfortable for the readers.

Best regards,
Ingo



Posted By: marian_pascalau
Date Posted: 28 Jun 07 at 5:01AM

Perry,

a short info. Please keep in mind that only few applications will protect data inside PDF files. If user is able to open your document he is able to modify whatever he wants.

 

There is no real way to protect your document for changes. The only possibility is to protect it with password and a digital certificate. Any user will be able to alter your document but will break for sure the signature of your original file.

 

Best regards, Marian

 



Posted By: bogey
Date Posted: 28 Jun 07 at 8:15AM
Locking a PDF with a password does nothing more than keep the honest people honest. It is far too easy to crack for someone that is determined.
 
 



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