]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added instructions for embedding.
authorJeremias Maerki <jeremias@apache.org>
Mon, 23 Jun 2003 08:36:13 +0000 (08:36 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 23 Jun 2003 08:36:13 +0000 (08:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196521 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/pdfencryption.xml

index 8db0446a894e7e4fe85e2d9879b6df98698d816c..e51dda0b9b31962162e58569b3cba51c50895d14 100755 (executable)
@@ -7,6 +7,7 @@
     <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>
@@ -30,7 +31,7 @@
       </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>