<title>PDF encryption.</title>
<authors>
<person name="J.Pietschmann" email="pietsch@apache.org"/>
+ <person name="Jeremias Märki" email="jeremias@apache.org"/>
</authors>
</header>
<body>
</p>
</section>
<section>
- <title>Usage</title>
+ <title>Usage (command line)</title>
<p>
Encryption is enabled by supplying any of the encryption related
options.
text, editing in Adobe Acrobat and making annotations, respectively.
</p>
</section>
+ <section>
+ <title>Usage (embedded)</title>
+ <p>
+ When FOP is embedded in another Java application you need to set an
+ options map on the renderer. These are the supported options:
+ </p>
+ <table>
+ <tr>
+ <th>Option</th>
+ <th>Description</th>
+ <th>Values</th>
+ <th>Default</th>
+ </tr>
+ <tr>
+ <td>ownerPassword</td>
+ <td>The owner password</td>
+ <td>String</td>
+ <td/>
+ </tr>
+ <tr>
+ <td>userPassword</td>
+ <td>The user password</td>
+ <td>String</td>
+ <td/>
+ </tr>
+ <tr>
+ <td>allowPrint</td>
+ <td>Allows/disallows printing of the PDF</td>
+ <td>"TRUE" or "FALSE"</td>
+ <td>"TRUE"</td>
+ </tr>
+ <tr>
+ <td>allowCopyContent</td>
+ <td>Allows/disallows copy/paste of content</td>
+ <td>"TRUE" or "FALSE"</td>
+ <td>"TRUE"</td>
+ </tr>
+ <tr>
+ <td>allowEditContent</td>
+ <td>Allows/disallows editing of content</td>
+ <td>"TRUE" or "FALSE"</td>
+ <td>"TRUE"</td>
+ </tr>
+ <tr>
+ <td>allowEditAnnotations</td>
+ <td>Allows/disallows editing of annotations</td>
+ <td>"TRUE" or "FALSE"</td>
+ <td>"TRUE"</td>
+ </tr>
+ </table>
+ <note>
+ Encryption is enabled as soon as one of these options is set.
+ </note>
+ <p>
+ An example to enable PDF encryption in Java code:
+ </p>
+ <source><![CDATA[
+Driver driver = new Driver();
+driver.setRenderer(Driver.RENDER_PDF);
+Map rendererOptions = new java.util.HashMap();
+rendererOptions.put("ownerPassword", "mypassword");
+rendererOptions.put("allowCopyContent", "FALSE");
+rendererOptions.put("allowEditContent", "FALSE");
+rendererOptions.put("allowPrint", "FALSE");
+driver.getRenderer().setOptions(rendererOptions);
+driver.setOutputStream(...]]></source>
+ </section>
<section>
<title>Environment</title>
<p>