Securing PDF Output on XML Publisher
Worked Example I – Securing a PDF output
You can now embed any of the XML Publisher properties into your RTF template <<reference to property lists>> These would then be resolved at runtime by the XML Publisher engine; you can either use hard coded values or embed the values inside the incoming XML data.
If you wanted to secure PDF output generated from a template you can use the XML Publisher pdf security properties and obtain the password value from the incoming XML data.
To add an XML Publisher property to a template use the Properties dialog (File -> Properties) :
picture 1: xdo-pdf-security
picture 2: xdo-pdf-open-password
The XML Publisher properties need to have ‘xdo-‘ as a prefix to their regular names so ‘pdf-open-password’ becomes ‘xdo-pdf-open-password’. Just add the XML Publisher properties and their value to the document using the dialog. If you want to reference a data element in the XML, a password for instance then use the curly braces in enclose the path to the XML element.
Worked Example II – Securing a PDF output
Lets assume that the XML data you are using will contain a specific password that needs to be used to secure the output document. Again we can use the document properties to set the PDF security password and reference a value in the XML. Assuming the following XML data:
<EY>
<security>true</security>
<password>welcome</password>
<EY_DETAILS>
..
<EY>
In the properties dialog we would enter two properties:
Name : xdo-pdf-security – this property sets whether the security feature is enabled or not
Type :Text
Value :{/EY/security}
Name : xdo-pdf-open-password – this property sets the password
Type :Text
Value :{/EY/password}
Storing the password in the XML data could be a security problem if the XML is going to persist in the system for any length of time. To avoid this you could achieve the same using a template parameter value that is generated and passed into the template at runtime. Assuming your parameters were called ‘PDFSec’ and ‘PDFPWD’ you would enter the following in the properties dialog:
Name : xdo-pdf-security – this property sets whether the security feature is enabled or not
Type :Text
Value :{$PDFSec}
Name : xdo-pdf-open-password – this property sets the password
Type :Text
Value :{$PDFPWD}
Both of these methods would then secure the output PDF document with a password that would only be know to the user.
Nguồn : https://ediyanto83.wordpress.com/2009/01/24/securing-pdf-output-on-xml-publisher/