Export.PDF.NativePDF.MasterPassword

Description

Setting that enables you to set a password for changing the security settings and permissions (copy/print/edit/etc.) of the generated PDF file, when you use the PDFlib method to save data from a DataWindow object to a PDF file. Therefore, this master password is also referred to as owner or permissions password.

Applies to

DataWindow objects

Syntax

PowerBuilder dot notation:

dw_control.Object.DataWindow.Export.PDF.NativePDF.MasterPassword

Describe argument:

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

Parameter

Description

value

(exp) The password for the administration permissions of the generated PDF file.

The value can be a string containing at least one character or no more than 37 characters. If more than 37 characters are set, the first 37 characters will be used as the password. The characters must be printable ASCII characters. Any unprintable ASCII characters will cause PB dot notation to throw an exception.


Usage

Once you set the master password, the user with the master password automatically has the permission of opening the file and all other permissions (such as copying, printing, editing etc.) to the PDF file.

Once you set the master password, you can further control the access restrictions of the file, for example, restrict opening the file by setting the Export.PDF.NativePDF.UserPassword property, or restrict copying/printing/editing/etc. the file by setting the Export.PDF.NativePDF.Restrictions property. If the master password is empty, it 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).

The master password cannot be the same as the user password which is set by the Export.PDF.NativePDF.UserPassword property, otherwise SaveAs function will fail and return -1.

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

Examples

This example sets the user password and 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.UserPassword = '123'
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 user password and the master password:

dw1.Modify("DataWindow.Export.PDF.Method = NativePDF!")
dw1.Modify("DataWindow.Export.PDF.NativePDF.UserPassword='123'")
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.PDFStandard

Export.PDF.NativePDF.Restrictions

Export.PDF.NativePDF.Subject

Export.PDF.NativePDF.UserPassword

Export.PDF.NativePDF.UsePrintSpec

Print.property