Export.PDF.NativePDF.Restrictions

Description

Setting that enables you to specify the permission settings that restrict certain actions (such as copying/printing/editing) of the generated PDF file, when you use the PDFlib method to save data from a DataWindow object to a PDF file.

Applies to

DataWindow objects

Syntax

PowerBuilder dot notation:

dw_control.Object.DataWindow.Export.PDF.NativePDF.Restrictions

Describe argument:

"DataWindow.Export.PDF.NativePDF.Restrictions { = 'value' }"

Parameter

Description

value

(exp) The password for opening the generated PDF file.

The value can be a string containing one or more of the following values (separated by ","):

  • 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.


Usage

If you set the restrictions of the PDF file, you must also set the master password by the Export.PDF.NativePDF.MasterPassword property. There must be a value specified for the restriction property, otherwise syntax error may occur. If you do not want to set any restriction, please set Export.PDF.NativePDF.MasterPassword to empty, which indicates no master password or user password is required to open the file or copy/print/edit the file (which means any one can open the file and copy/print/edit the file with no restrictions).

If you set restrictions without setting the user password, a user can open the PDF file, and has the permissions specified by the restriction property.

This property takes no effect for files created using PDF/A standard.

Examples

This example prevents the PDF file being printed and copied, sets the master password, and saves the data to a file called custom.pdf:

int li_ret
dw_1.Object.DataWindow.Export.PDF.Method = NativePDF!
dw_1.Object.DataWindow.Export.PDF.NativePDF.Restrictions = 'noprint!,nocopy!'
dw_1.Object.DataWindow.Export.PDF.NativePDF.MasterPassword = '456'
li_ret = dw_1.SaveAs("c:\custom.pdf",PDF!, true)

This example uses Modify to set the restrictions and the master password:

dw1.Modify("DataWindow.Export.PDF.Method = NativePDF!")
dw1.Modify("DataWindow.Export.PDF.NativePDF.Restrictions='noprint!,nocopy!'")
dw1.Modify("DataWindow.Export.PDF.NativePDF.MasterPassword='456'")

See also

Export.PDF.Method

Export.PDF.NativePDF.Author

Export.PDF.NativePDF.CustomOrientation

Export.PDF.NativePDF.CustomSize

Export.PDF.NativePDF.ImageFormat

Export.PDF.NativePDF.Keywords

Export.PDF.NativePDF.MasterPassword

Export.PDF.NativePDF.PDFStandard

Export.PDF.NativePDF.Subject

Export.PDF.NativePDF.UserPassword

Export.PDF.NativePDF.UsePrintSpec

Print.property