xml-xsl-fo-pdf
Toto je starší verze dokumentu!
XML+XSL-FO+PDF
FOP
Čeština
Zdroj: http://www.kosek.cz/sw/fop/
Do fop-1.1/conf/fop.xconf element fonts vložit <auto-detect/>.
Podopora dělení slov
http://sourceforge.net/projects/offo/files/latest/download?source=dlp
fop-hyph.jar vložit do fop-1.1/lib
České TTF fonty
Instalace
Stažení a rozbalení FOP
shell# mkdir fop; cd fop shell# wget -c -t 0 ftp://mirror.hosting90.cz/apache/xmlgraphics/fop/binaries/fop-1.1-bin.tar.gz shell# tar xvzf fop-1.1-bin.tar.gz
Dělení českých slov
Stáhnout: http://sourceforge.net/projects/offo/files/latest/download?source=dlp
shell# unzip offo-hyphenation-binary_v2.0.zip shell# cp ./offo-hyphenation-binary/fop-hyph.jar ./fop-1.1/lib
Stažení TTF fontů
shell# mkdir fonts-cab
Stáhnout: http://sourceforge.net/projects/corefonts/files/the%20fonts/final/
- andale32.exe
- arialb32.exe
- arial32.exe
- comic32.exe
- courie32.exe
- georgi32.exe
- impact32.exe
- times32.exe
- trebuc32.exe
- verdan32.exe
- webdin32.exe
Extrahování TTF fontů z CAB
shell# yum install cabextract.x86_64 shell# cabextract ./fonts-cab/* shell# mkdir fonts shell# cp ./fonts-cab/*.TTF ./fonts
Vytvoření metric pro TTF fonty
http://xmlgraphics.apache.org/fop/1.1/fonts.html
- create-ttf-metrics.sh
#!/bin/bash # # Create TrueType Font Metrics # # Author: Jiří Blažek (blazek@isn.cz) # # FOP path FOP_PATH="./fop-1.1" # True Type Fonts path TTF_PATH="./fonts" # extension from EXT_FROM="ttf" # extension to EXT_TO="xml" # rename files from upper to lower for TTF_FILE in $(ls $TTF_PATH/*.TTF); do mv $TTF_FILE $(echo $TTF_FILE | tr '[:upper:]' '[:lower:]'); done # Create TrueType Font Metrics for TTF_FILE in $(ls $TTF_PATH/*.ttf); do XML_FILE=$(echo $TTF_FILE | sed "s/\(.*\.\)$EXT_FROM/\1$EXT_TO/"); java -cp $FOP_PATH/build/fop.jar:$FOP_PATH/lib/avalon-framework-4.2.0.jar:$FOP_PATH/lib/commons-logging-1.0.4.jar:$FOP_PATH/lib/commons-io-1.3.1.jar:$FOP_PATH/lib/commons-logging-1.0.4.jar:$FOP_PATH/lib/xmlgraphics-commons-1.5.jar org.apache.fop.fonts.apps.TTFReader $TTF_FILE $XML_FILE; done
shell# chmod 755 create-ttf-metrics.sh shell# ./create-ttf-metrics.sh
Přesun fontů do FOP
shell# mv fonts fop-1.1
Konfigurace fop.xconf
http://xmlgraphics.apache.org/fop/1.1/configuration.html
- ./fop-1.1/conf/fop.xconf
<font-base>../fonts</font-base> ... <fonts> <font metrics-file="arial.xml" kerning="yes" embed-url="arial.ttf"> <font-triplet name="Arial" style="normal" weight="normal"/> <font-triplet name="sans-serif" style="normal" weight="normal"/> </font> <font metrics-file="ariali.xml" kerning="yes" embed-url="ariali.ttf"> <font-triplet name="Arial" style="italic" weight="normal"/> <font-triplet name="sans-serif" style="italic" weight="normal"/> </font> <font metrics-file="arialbi.xml" kerning="yes" embed-url="arialbi.ttf"> <font-triplet name="Arial" style="italic" weight="bold"/> <font-triplet name="sans-serif" style="italic" weight="bold"/> </font> <font metrics-file="arialbd.xml" kerning="yes" embed-url="arialbd.ttf"> <font-triplet name="Arial" style="normal" weight="bold"/> <font-triplet name="sans-serif" style="normal" weight="bold"/> </font> <auto-detect/> </fonts>
Spuštění
shell# ./fop-1.1/fop -c ./fop-1.1/conf/fop.xconf -xml ./xml/test.xml ./xsl/test.xsl -pdf ./pdf/test.pdf
xml-xsl-fo-pdf.1377530444.txt.bz2 · Poslední úprava: 2023/12/26 19:13 (upraveno mimo DokuWiki)