You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Evangelos Vlachogiannis <ev...@aegean.gr> on 2006/10/06 20:06:05 UTC

greek characters work for pdf

Hi list,

I am trying to make greek characters work for pdf. I have found around a 
lot but nothing worked for me. Is there a how-to or can anyone send me 
steps howto do it?
Note that I use static export and the html ver chars are fine.

thnx,
Vangelis


Re: greek characters work for pdf

Posted by Børre Gaup <bo...@skolelinux.no>.
Bear, golggotmánu 6. b. 2006 20.11, Evangelos Vlachogiannis čálii:
> also pdf table of contents is fine!! but still text appears "######"
>

I had the same problem for the sami characters šŧŋđžč.

I got this working by embedding characters into the pdfs. 

I began by reading http://cocoon.apache.org/2.1/userdocs/pdf-serializer.html. 

These are the steps I took to make it work (works on Linux and Mac OS X):

1. Make a directory <yourproject>/src/documentation/resources/fonts
2. Download DejaVu truetype fonts. 
http://dejavu.sourceforge.net/wiki/index.php/Download
2. Unpack the fonts in to the above mentioned fonts directory
3. Create font metrics files. This is done on the command line.
cd <yourproject>/src/documentation/resources/fonts
for i in *.ttf do;
java -cp "$FORREST_HOME/lib/core/fop-0.20.5.jar;
$FORREST_HOME/lib/endorsed/xercesImpl-2.8.0.jar;
$FORREST_HOME/lib/endorsed/xml-apis-1.3.03.jar" 
org.apache.fop.fonts.apps.TTFReader $i $i.xml;done

There are 21 different font files in the dejavu archive, so the previous line 
will go through them one by one, and make font metrics files for each and 
everyone of them. The alternative is to write:

java -cp "$FORREST_HOME/lib/core/fop-0.20.5.jar;
$FORREST_HOME/lib/endorsed/xercesImpl-2.8.0.jar;
$FORREST_HOME/lib/endorsed/xml-apis-1.3.03.jar" 
org.apache.fop.fonts.apps.TTFReader <fontfile> <fontfile>.xml

for each and everyone of the font files ...

4. Create a custom font configuration file. I attach the one I use. 
Notice that it has absolute paths, so you will have to change them to fit to 
your directory structure. ( I tried to make this work without absolute paths, 
but to no avail).

5. Configure the fo2pdf serializer
Open the file 
$FORREST_HOME/plugins/org.apache.forrest.plugin.output.pdf/output.xmap

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

To:
<map:serializer name="fo2pdf"
                src="org.apache.cocoon.serialization.FOPSerializer"
                mime-type="application/pdf">
  
<user-config><path-to-your-project>/src/documentation/resources/fonts/config.xml</user-config>
</map:serializer>

After that:
cd $FORREST_HOME/plugins/org.apache.forrest.plugin.output.pdf
ant local-deploy

Then your changes ought to emerge in 
$FORREST/build/plugins/org.apache.forrest.plugin.output.pdf/output.xmap


6. Make forrest use these changes:
a. Copy the directory $FORREST_HOME/main/webapp/skins/common to 
<yourproject>/src/documentation/skins. That means inside the directory 
<yourprojectr>/src/documentations/skins you should have a directory called 
common when you are finished copying ... ;)

b. Edit the files in common/xslt/fo/
I attach mine, change to suit your taste.

There sure has snuck some errors into this explanation, there are plenty of 
stepping stones. So please give feedback if this was of any use.


-- 
Børre Gaup, Tromsø

Re: greek characters work for pdf

Posted by Evangelos Vlachogiannis <ev...@aegean.gr>.
also pdf table of contents is fine!! but still text appears "######"

Evangelos Vlachogiannis wrote:
> Hi list,
> 
> I am trying to make greek characters work for pdf. I have found around a 
> lot but nothing worked for me. Is there a how-to or can anyone send me 
> steps howto do it?
> Note that I use static export and the html ver chars are fine.
> 
> thnx,
> Vangelis
>