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 ","):
|
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.NativePDF.CustomOrientation
Export.PDF.NativePDF.CustomSize
Export.PDF.NativePDF.ImageFormat
Export.PDF.NativePDF.MasterPassword
Export.PDF.NativePDF.PDFStandard
Export.PDF.NativePDF.UserPassword