       An example to enable PDF encryption in Java code:
      </p>
<pre class="code">
import org.apache.fop.pdf.PDFEncryptionParams;

[..]

FOUserAgent userAgent = fopFactory.newFOUserAgent();
useragent.getRendererOptions().put("encryption-params", new PDFEncryptionParams(
    null, "password", false, false, true, true));
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
[..]</pre>
<p>
        The parameters for the constructor of PDFEncryptionParams are:
      </p>
<ol>
        
<li>userPass