Unconfigured Ad Widget



No announcement yet.

Password-Protect PDF in the IFS

  • Filter
  • Time
  • Show
Clear All
new posts

  • Password-Protect PDF in the IFS

    I have been able to generate a PDF into the IFS, using the techniques described in the book Advanced Integrated RPG. I would like to be able to password-protect this file, however, and wondered if anyone had developed the modifications to the code that would run the appropriate method to set a password on the file.

    Thanks in advance.

  • #2
    Figured It Out!

    I figured out how to do this! It required passing an option password argument to the AIRPDF_NEWDOCUMENTOUTPUT prototype, and adding a prototype to process the SETENCRYPTION method of class PDFWRITER. Also code was added to the AIRPDF_NEWDOCUMENTOUTPUT procedure interface, to process the optional password, if passed in, and invoke the SETENCRYPTION method of PDFWRITER. An additional JAR file was needed which identifies the encryption processing being done via iText.

    It works!