Bonjour,
J'essaye de générer un fichier pdf à partir de mon .fo, mais impossible d'avoir d'autre police, pourtant j'ai créé un fichier de configation avec les noms de mes polices.
fichier de configuration :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
| <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<fonts>
<font metrics-file="fonts/ANTQUAB.xml" kerning="yes" embed-file="fonts/ANTQUAB.ttf">
<font-triplet name="Book Antiqua" style="normal" weight="bold"/>
</font>
<font metrics-file="fonts/ANTQUABI.xml" kerning="yes" embed-file="fonts/ANTQUABI.ttf">
<font-triplet name="Book Antiqua" style="italic" weight="bold"/>
</font>
<font metrics-file="fonts/ANTQUAI.xml" kerning="yes" embed-file="fonts/ANTQUAI.ttf">
<font-triplet name="Book Antiqua" style="italic" weight="normal"/>
</font>
<font metrics-file="fonts/arial.xml" kerning="yes" embed-file="fonts/arial.ttf">
<font-triplet name="Arial" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/arialbd.xml" kerning="yes" embed-file="fonts/arialbd.ttf">
<font-triplet name="Arial" style="normal" weight="bold"/>
</font>
<font metrics-file="fonts/arialbi.xml" kerning="yes" embed-file="fonts/arialbi.ttf">
<font-triplet name="Arial" style="italic" weight="bold"/>
</font>
<font metrics-file="fonts/ariali.xml" kerning="yes" embed-file="fonts/ariali.ttf">
<font-triplet name="Arial" style="italic" weight="normal"/>
</font>
<font metrics-file="fonts/ariblk.xml" kerning="yes" embed-file="fonts/ariblk.ttf">
<font-triplet name="Arial Black" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/BKANT.xml" kerning="yes" embed-file="fonts/BKANT.ttf">
<font-triplet name="Book Antiqua" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/comic.xml" kerning="yes" embed-file="fonts/comic.ttf">
<font-triplet name="Comic Sans MS" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/comicbd.xml" kerning="yes" embed-file="fonts/comicbd.ttf">
<font-triplet name="Comic Sans MS" style="normal" weight="bold"/>
</font>
<font metrics-file="fonts/cour.xml" kerning="yes" embed-file="fonts/cour.ttf">
<font-triplet name="Courier New" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/courbd.xml" kerning="yes" embed-file="fonts/courbd.ttf">
<font-triplet name="Courier New" style="normal" weight="bold"/>
</font>
<font metrics-file="fonts/courbi.xml" kerning="yes" embed-file="fonts/courbi.ttf">
<font-triplet name="Courier New" style="italic" weight="bold"/>
</font>
<font metrics-file="fonts/couri.xml" kerning="yes" embed-file="fonts/couri.ttf">
<font-triplet name="Courier New" style="italic" weight="normal"/>
</font>
<font metrics-file="fonts/georgia.xml" kerning="yes" embed-file="fonts/georgia.ttf">
<font-triplet name="Georgia" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/georgiab.xml" kerning="yes" embed-file="fonts/georgiab.ttf">
<font-triplet name="Georgia" style="normal" weight="bold"/>
</font>
<font metrics-file="fonts/georgiai.xml" kerning="yes" embed-file="fonts/georgiai.ttf">
<font-triplet name="Georgia" style="italic" weight="normal"/>
</font>
<font metrics-file="fonts/georigiaz.xml" kerning="yes" embed-file="fonts/georigiaz.ttf">
<font-triplet name="Georgia" style="italic" weight="bold"/>
</font>
<font metrics-file="fonts/impact.xml" kerning="yes" embed-file="fonts/impact.ttf">
<font-triplet name="Impact" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/tahoma.xml" kerning="yes" embed-file="fonts/tahoma.ttf">
<font-triplet name="Tahoma" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/tahomabd.xml" kerning="yes" embed-file="fonts/tahomabd.ttf">
<font-triplet name="Tahoma" style="normal" weight="bold"/>
</font>
<font metrics-file="fonts/times.xml" kerning="yes" embed-file="fonts/times.ttf">
<font-triplet name="Times New Roman" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/timesbd.xml" kerning="yes" embed-file="fonts/timesbd.ttf">
<font-triplet name="Times New Roman" style="normal" weight="bold"/>
</font>
<font metrics-file="fonts/timesbi.xml" kerning="yes" embed-file="fonts/timesbi.ttf">
<font-triplet name="Times New Roman" style="italic" weight="bold"/>
</font>
<font metrics-file="fonts/timesi.xml" kerning="yes" embed-file="fonts/timesi.ttf">
<font-triplet name="Times New Roman" style="italic" weight="normal"/>
</font>
<font metrics-file="fonts/trebuc.xml" kerning="yes" embed-file="fonts/trebuc.ttf">
<font-triplet name="Trebuchet MS" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/trebucbd.xml" kerning="yes" embed-file="fonts/trebucbd.ttf">
<font-triplet name="Trebuchet MS" style="normal" weight="bold"/>
</font>
<font metrics-file="fonts/trebucbi.xml" kerning="yes" embed-file="fonts/trebucbi.ttf">
<font-triplet name="Trebuchet MS" style="italic" weight="bold"/>
</font>
<font metrics-file="fonts/trebucit.xml" kerning="yes" embed-file="fonts/trebucit.ttf">
<font-triplet name="Trebuchet MS" style="italic" weight="normal"/>
</font>
<font metrics-file="fonts/verdana.xml" kerning="yes" embed-file="fonts/verdana.ttf">
<font-triplet name="Verdana" style="normal" weight="normal"/>
</font>
<font metrics-file="fonts/verdanab.xml" kerning="yes" embed-file="fonts/verdanab.ttf">
<font-triplet name="Verdana" style="normal" weight="bold"/>
</font>
<font metrics-file="fonts/verdanai.xml" kerning="yes" embed-file="fonts/verdanai.ttf">
<font-triplet name="Verdana" style="italic" weight="normal"/>
</font>
<font metrics-file="fonts/verdanaz.xml" kerning="yes" embed-file="fonts/verdanaz.ttf">
<font-triplet name="Verdana" style="italic" weight="bold"/>
</font>
</fonts>
</configuration> |
Et voilà le code xsl:fo que j'essaye d'executer:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| <?xml version="1.0"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4L" page-width="297mm" page-height="210mm">
<fo:region-body margin-top="12.5mm" margin-bottom="12.5mm" margin-left="25mm" margin-right="25mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4L">
<fo:flow flow-name="xsl-region-body">
<fo:block-container position="absolute" top="0" left="0">
<fo:block>
<fo:external-graphic src="http://docs.google.com/presently/images/themes/rustic_sm.jpg" left="0" top="0" content-height="185mm" content-width="247mm"/>
</fo:block>
</fo:block-container>
<fo:block>
<fo:block-container position="absolute" top="81.915mm" left="18.0975mm" width="95.25mm">
<fo:block>Entrez votre <fo:block/><fo:block text-align="right">texte ici.<fo:block/><fo:block text-align="center">test</fo:block></fo:block></fo:block>
</fo:block-container>
</fo:block>
<fo:block-container position="absolute" top="20.32mm" left="159.385mm">
<fo:block>
<fo:external-graphic src="http://www.generatix.fr/images/elephpant-elephant-php-logo.png" content-width="77.7875mm" content-height="49.8475mm"/>
</fo:block>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="A4L">
<fo:flow flow-name="xsl-region-body">
<fo:block-container position="absolute" top="0" left="0">
<fo:block/>
</fo:block-container>
<fo:block>
<fo:block-container position="absolute" top="15.875mm" left="15.875mm" width="95.25mm">
<fo:block>Entre<fo:inline font-size="18pt" font-family="sans-serif" color="black">z <fo:inline font-weight="bold">votre</fo:inline> texte ici.</fo:inline> Ente<fo:inline font-size="12pt" font-family="comic sans ms,sans-serif" color="black">z votre te</fo:inline>xt ici.<fo:list-block provisional-distance-between-starts="1cm" provisional-label-separation="0.5cm" space-after="12pt" start-indent="1cm"><fo:list-item><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block>test 1</fo:block></fo:list-item-body></fo:list-item><fo:list-item><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block>test 2<fo:list-block provisional-distance-between-starts="1cm" provisional-label-separation="0.5cm" space-after="0pt" start-indent="2.25cm"><fo:list-item><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block>test2.1</fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block>
</fo:block-container>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root> |
Et là commande que j'utilise pour générer mon fichier pdf :
fop\fop -c fop\conf\userconf.xml -xml visite.xml -xsl slideA4L.xsl visite.pdf
Mes polices (les .ttf et .xml) sont dans le repertoire fop/fonts
Je ne sais vraiment pas d'où peut venir ce problème, je débute avec fop.
Merci d'avance.
Partager