Thursday, June 10, 2010

XML Publisher and PDF output with Password Protection

Many times we have requirement to generate the PDF output with a Password Protection. In PeopleSoft we can generate the Output report in different format using XML publisher.

Protect with Same Password

For this purpose, you need to modify XDO.cfg file. This will have all pdf to be protected with same password.

Protect with Different Password

From 8.50 users can have different password for different pdf.

Navigate to: - Main Menu == Reporting Tools == XML Publisher == Report Definition

Select report Name and go to Properties Tab. Select Property Group as "pdf Security". User can define the Default Password here.

Using PeopleCode Password can be set dynamically for pdf output.

&TestProperty = CreateArrayRept("", 0);
& TestPropertyValue = CreateArrayRept("", 0);
&TestProperty.Push("pdf-open-password");
& TestPropertyValue.Push("password123"); (This can be generated Randomly by Rand() function)
&oRptDefn.SetRuntimeProperties(&TestProperty, & TestPropertyValue);
&oRptDefn.ProcessReport(&sTemplateId, %Language_User, &dAsOfDate, &sOutputFormat);

No comments:

Post a Comment