Export.PDF.NativePDF.MasterPassword
property (DataWindow object)
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:
|
1 |
dw_control.Object.DataWindow.Export.PDF.NativePDF.MasterPassword |
Describe argument:
|
1 |
"DataWindow.Export.PDF.NativePDF.MasterPassword { = 'value' }" |
|
Parameter |
Description |
|---|---|
|
value |
(exp) The password for the administration The value can |
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:
|
1 2 3 4 5 |
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:
|
1 2 3 |
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.NativePDF.CustomOrientation
Export.PDF.NativePDF.CustomSize
Export.PDF.NativePDF.ImageFormat
Export.PDF.NativePDF.PDFStandard
Export.PDF.NativePDF.Restrictions
Export.PDF.NativePDF.UserPassword