1. Falguni Patel
  2. PowerBuilder
  3. Wednesday, 5 October 2022 04:48 AM UTC

Hi,

We are generating some pdf letters by exporting data window to pdf and sending these letters via email. The signature contained in letter can be cropped and used any where. How can I generate a non-editable pdf document? 

Please assist.

 

Accepted Answer
Andreas Mykonios Accepted Answer Pending Moderation
  1. Wednesday, 5 October 2022 06:11 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi.

You don't say which method you use to create your pdf. If it's nativepdf then you should take a look to NativePDF.Restrictions restrictions option:

<your datawindow>.Object.DataWindow.Export.PDF.NativePDF.Restrictions = 'noprint!,nohiresprint!,nocopy!,nomodify!,noannots!,noforms!'

Explanation of valid parameters from help file:

  • noprint! - Acrobat will prevent printing the file.
  • nohiresprint! - Acrobat will prevent high-resolution printing. If noprint is not set, printing is restricted to the print as image feature which prints a low-resolution rendition of the page.
  • nomodify! - Acrobat will prevent editing or cropping pages and creating or changing form fields.
  • noassemble! - Acrobat will prevent inserting, deleting, or rotating pages and creating bookmarks and thumbnails.
    noannots! - Acrobat will prevent creating or changing annotations and form fields.
  • noforms! - Acrobat will prevent form field filling. (implies nomodify and noannots)
    nocopy! - Acrobat will prevent copying and extracting text or graphics; the accessibility interface will be controlled by noaccessible.
  • noaccessible! - (Obsolete in PDF 2.0; not allowed in PDF/UA-1) Acrobat will prevent extracting text or graphics for accessibility
  • plainmetadata! - (PDF 1.5) Keep XMP document metadata unencrypted even in an encrypted document.

Another thing you have to do is to password protect your pdf using MasterPassword property:

<your datawindow>.Object.DataWindow.Export.PDF.NativePDF.MasterPassword = 'Some Password'

That way you will protect those settings. Of course you should use a strong password.

Those should be done before saving your datawindow.

I will mention that this can't protect you from screen captures! So it's a good precaution...

As far as I know the real secure way to protect a pdf file would be to digitally sign it. This isn't currently directly supported by PowerBuilder, but you can find 3rd party sdk vendors or some online api's doing that. That way it can be verified if a document is authentic.

Andreas.

Comment
  1. Falguni Patel
  2. Wednesday, 5 October 2022 21:13 PM UTC
Thanks for your detailed response. Much appreciated!
  1. Helpful
  1. Olan Knight
  2. Thursday, 6 October 2022 22:17 PM UTC
Fabulous information, Andreas! Thank you!
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.