Return-Path: Delivered-To: apmail-cocoon-docs-archive@www.apache.org Received: (qmail 17452 invoked from network); 19 Aug 2005 20:26:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Aug 2005 20:26:42 -0000 Received: (qmail 4523 invoked by uid 500); 19 Aug 2005 20:26:41 -0000 Delivered-To: apmail-cocoon-docs-archive@cocoon.apache.org Received: (qmail 4499 invoked by uid 500); 19 Aug 2005 20:26:41 -0000 Mailing-List: contact docs-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: docs@cocoon.apache.org List-Id: Delivered-To: mailing list docs@cocoon.apache.org Received: (qmail 4485 invoked by uid 99); 19 Aug 2005 20:26:41 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [207.7.158.203] (HELO cocoon.zones.apache.org) (207.7.158.203) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2005 13:26:40 -0700 Message-ID: <22318418.1124483053682.JavaMail.daisy@cocoon.zones.apache.org> Date: Fri, 19 Aug 2005 20:24:13 +0000 (GMT+00:00) From: daisy@cocoon.zones.apache.org To: docs@cocoon.apache.org Subject: [DAISY] Updated: PDF Serializer Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N A document has been updated: http://cocoon.zones.apache.org/daisy/documentation/550.html Document ID: 550 Branch: main Language: default Name: PDF Serializer (unchanged) Document Type: Document (unchanged) Updated on: 8/19/05 8:24:02 PM Updated by: Helma van der Linden A new version has been created, state: publish Parts ===== Content ------- This part has been updated. Mime type: text/xml (unchanged) File name: (unchanged) Size: 8245 bytes (previous version: 7227 bytes) Content diff: (46 equal lines skipped)

Windows:

---
--- $ cd %PATH_TO_COCOON%\lib
+++ 
$ cd %PATH_TO_COCOON%\lib
    $ java -cp optional\fop-0.20.4.jar;core\xercesImpl-2.0.0.jar;core\xml-apis.jar \
      org.apache.fop.fonts.apps.TTFReader \
      %PATH_TO_FONT% %PATH_TO_METRICS_DIR%\%FONT_NAME%.xml
                

Unix:

---
--- $ cd $PATH_TO_COCOON/lib
+++ 
$ cd $PATH_TO_COCOON/lib
    $ java -cp optional/fop-0.20.4.jar;core/xercesImpl-2.0.0.jar;core/xml-apis.jar \
      org.apache.fop.fonts.apps.TTFReader \
      $PATH_TO_FONT  $PATH_TO_METRICS_DIR/$FONT_NAME.xml
(23 equal lines skipped)
    
    

Create the metrics for arial.ttf, arialb.ttf, arialbi.ttf, ariali.ttf

---
--- $ java -cp optional\fop-0.20.4.jar;core\xercesImpl-2.0.0.jar;core\xml-apis.jar \
+++ 
$ java -cp optional\fop-0.20.4.jar;core\xercesImpl-2.0.0.jar;core\xml-apis.jar \
      org.apache.fop.fonts.apps.TTFReader \
      C:\WINNT\Fonts\arial.ttf D:\fop-fonts\arial.ttf.xml
    $ java -cp optional\fop-0.20.4.jar;core\xercesImpl-2.0.0.jar;core\xml-apis.jar \
(20 equal lines skipped)
    add other types of fonts (if you want to read the FOP docs) and the
    .ttf tells me where to locate the font.

---
--- <configuration>
+++ 
<configuration>
      <fonts>
        <font metrics-file="D:/fop-fonts/arial.ttf.xml" 
              kerning="yes" embed-file="C:/WINNT/Fonts/arial.ttf">
(29 equal lines skipped)
    font is specified as 'ArialMT' (it's proper name) it will still work. Think of
    it as an alias capability.

---

Sitemap and fo2pdf serializer.

+++

Sitemap and fo2pdf serializer

All that remains is to tell the serializer, where your config file is located. Find the line in your sitemap which looks like:

---
--- <map:serializer name="fo2pdf"
+++ 
<map:serializer name="fo2pdf"
                    src="org.apache.cocoon.serialization.FOPSerializer"
                    mime-type="application/pdf"/>
    

and replace it with:

---
--- <map:serializer name="fo2pdf"
+++ 
<map:serializer name="fo2pdf"
                    src="org.apache.cocoon.serialization.FOPSerializer"
                    mime-type="application/pdf">
      <user-config>D:/fop-fonts/config.xml</user-config>
(13 equal lines skipped)
    config file; always delete your cache-dir after modifying your
    config file.

+++

PDF encryption

+++ +++

FOP supports encryption of PDF output, thanks to Patrick C. Lankswert. This +++ feature is commonly used to prevent unauthorized viewing, printing, editing, +++ copying text from the document and doing annotations. It is also possible to ask +++ the user for a password in order to view the contents.

+++ +++

How to encrypt pdf

+++ +++

First install an encryption provider as described in the fop documentation. +++

+++ +++

You can configure the FOPSerializer like this (since 2.1.5-dev):

+++ +++
<map:serializer name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer" mime-type="application/pdf">
+++   <renderer-config>
+++      <parameter name="ownerPassword" value="mypassword"/>
+++      <parameter name="allowCopyContent" value="FALSE"/>
+++      <parameter name="allowEditContent" value="FALSE"/>
+++      <parameter name="allowPrint" value="FALSE"/>
+++      <parameter name="allowEditAnnotations" value="FALSE"/>
+++   </renderer-config>
+++ </map:serializer>
+++ Fields ====== no changes Links ===== no changes Custom Fields ============= no changes Collections =========== Removed from collection: legacydocs Added to collection: documentation