Uživatelské nástroje

Nástroje pro tento web


xml-xsl-fo-pdf
no way to compare when less than two revisions

Rozdíly

Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.


Předchozí verze
Následující verze
xml-xsl-fo-pdf [2013/08/26 17:20] – [Instalace] blazek
Řádek 1: Řádek 1:
 +====== XML+XSL-FO+PDF ======
  
 +===== FOP =====
 +
 +http://xmlgraphics.apache.org/fop/1.1/
 +
 +
 +
 +==== Č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__
 +
 +http://corefonts.sourceforge.net/
 +
 +==== Instalace ====
 +
 +**Stažení a rozbalení FOP**
 +
 +<code>
 +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
 +</code>
 +
 +**Dělení českých slov**
 +
 +Stáhnout: http://sourceforge.net/projects/offo/files/latest/download?source=dlp
 +
 +<code>
 +shell# unzip offo-hyphenation-binary_v2.0.zip
 +shell# cp ./offo-hyphenation-binary/fop-hyph.jar ./fop-1.1/lib
 +</code>
 +
 +**Stažení TTF fontů**
 +
 +<code>
 +shell# mkdir fonts-cab
 +</code>
 +
 +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**
 +
 +<code>
 +shell# yum install cabextract.x86_64
 +shell# cabextract ./fonts-cab/*
 +shell# mkdir fonts
 +shell# cp ./fonts-cab/*.TTF ./fonts
 +</code>
 +
 +**Vytvoření metric pro TTF fonty**
 +
 +http://xmlgraphics.apache.org/fop/1.1/fonts.html
 +
 +<file bash 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
 +</file>
 +
 +<code>
 +shell# chmod 755 create-ttf-metrics.sh
 +shell# ./create-ttf-metrics.sh
 +</code>
 +
 +**Přesun fontů do FOP**
 +
 +<code>
 +shell# mv fonts fop-1.1
 +</code>
 +
 +**Konfigurace fop.xconf**
 +
 +http://xmlgraphics.apache.org/fop/1.1/configuration.html
 +
 +<file xml ./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>
 +</file>
 +==== Spuštění ====
 +
 +<code>
 +shell# ./fop-1.1/fop -c ./fop-1.1/conf/fop.xconf -xml ./xml/test.xml ./xsl/test.xsl -pdf ./pdf/test.pdf
 +</code>
xml-xsl-fo-pdf.txt · Poslední úprava: 2023/12/26 19:13 autor: 127.0.0.1