Return-Path:
Windows: Unix: Create the metrics for arial.ttf, arialb.ttf, arialbi.ttf, ariali.ttf
--- $ 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
--- $ 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)
--- $ 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>+++