Пытаюсь разобраться с кириллицей. Не получается
FOP 1.0
Конфигурацию подключаю так
<!--shcode--><pre><code class='java'>fopFactory.setUserConfig(conffile);[/CODE]
Файлы метрик есть. Лежат с фонтами тут file:/d://lotus//domino//data
<div class="sp-wrap"><div class="sp-head-wrap"><div class="sp-head folded clickable">Файл конфигурации</div></div><div class="sp-body"><div class="sp-content"><!--shcode--><pre><code class='xml'><?xml version="1.0"?>
<!-- NOTE: This is the version of the configuration -->
<fop version="1.0">
<!-- Base URL for resolving relative URLs -->
<base>file:/d://lotus//domino</base>
<!-- Font Base URL for resolving relative font URLs -->
<font-base>file:/d://lotus//domino//data</font-base>
<!--hyphenation-base>c:/MyWay/hyph/</hyphenation-base -->
<!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
<source-resolution>300</source-resolution>
<!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
<target-resolution>300</target-resolution>
<strict-validation>false</strict-validation>
<!-- Default page-height and page-width, in case
value is specified as auto -->
<default-page-settings height="297mm" width="210mm"/>
<!-- Information for specific renderers -->
<!-- Uses renderer mime type for renderers -->
<renderers>
<renderer mime="application/pdf">
<filterList>
<!-- provides compression using zlib flate (default is on) -->
<value>flate</value>
<!-- encodes binary data into printable ascii characters (default off)
This provides about a 4:5 expansion of data size -->
<!-- <value>ascii-85</value> -->
<!-- encodes binary data with hex representation (default off)
This filter is not recommended as it doubles the data size -->
<!-- <value>ascii-hex</value> -->
</filterList>
<fonts>
<font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
<font-triplet name="Arial" style="normal" weight="normal"/>
<font-triplet name="ArialMT" style="normal" weight="normal"/>
</font>
<font metrics-url="arialbd.xml" kerning="yes" embed-url="arialbd.ttf">
<font-triplet name="Arial" style="normal" weight="bold"/>
<font-triplet name="ArialMT" style="normal" weight="bold"/>
</font>
<font metrics-url="ariali.xml" kerning="yes" embed-url="ariali.ttf">
<font-triplet name="Arial" style="italic" weight="normal"/>
<font-triplet name="ArialMT" style="italic" weight="normal"/>
</font>
<font metrics-url="arialbi.xml" kerning="yes" embed-url="arialbi.ttf">
<font-triplet name="Arial" style="italic" weight="bold"/>
<font-triplet name="ArialMT" style="italic" weight="bold"/>
</font>
</fonts>
<!-- This option lets you specify additional options on an XML handler -->
<!--xml-handler namespace="http://www.w3.org/2000/svg">
<stroke-text>false</stroke-text>
</xml-handler-->
</renderer>
<renderer mime="application/postscript">
<!-- This option forces the PS renderer to rotate landscape pages -->
<!--auto-rotate-landscape>true</auto-rotate-landscape-->
<!-- This option lets you specify additional options on an XML handler -->
<!--xml-handler namespace="http://www.w3.org/2000/svg">
<stroke-text>false</stroke-text>
</xml-handler-->
</renderer>
<renderer mime="application/vnd.hp-PCL">
</renderer>
<!-- MIF does not have a renderer
<renderer mime="application/vnd.mif">
</renderer>
-->
<renderer mime="image/svg+xml">
<format type="paginated"/>
<link value="true"/>
<strokeText value="false"/>
</renderer>
<renderer mime="application/awt">
</renderer>
<renderer mime="text/xml">
</renderer>
<!-- RTF does not have a renderer
<renderer mime="text/rtf">
</renderer>
-->
<renderer mime="text/plain">
<pageSize columns="80"/>
</renderer>
</renderers>
</fop>[/CODE]
И получаю ошибку
<div class="sp-wrap"><div class="sp-head-wrap"><div class="sp-head folded clickable">Ошибка</div></div><div class="sp-body"><div class="sp-content">
Код:
Failed to read font metrics file arial.xml
org.apache.fop.apps.FOPException: Missing metrics-version attribute - please regenerate the font metrics file with a more recent version of FOP.
org.xml.sax.SAXException: Missing metrics-version attribute - please regenerate the font metrics file with a more recent version of FOP.
at org.apache.fop.fonts.FontReader.createFont(FontReader.java:93)
at org.apache.fop.fonts.FontReader.<init>(FontReader.java:140)
at org.apache.fop.fonts.LazyFont.load(LazyFont.java:119)
at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:241)
at org.apache.fop.fonts.Font.getAscender(Font.java:106)
at org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:87)
at org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:120)
at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:69)
at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:216)
at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:692)
at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:149)
at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:132)
at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:337)
at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107)
at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238)
at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:261)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1399)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262)
at ExampleXML2PDF.main(ExampleXML2PDF.java:121)
Caused by: org.xml.sax.SAXException: Missing metrics-version attribute - please regenerate the font metrics file with a more recent version of FOP.
at org.apache.fop.fonts.apps.TTFReader.checkMetricsVersion(TTFReader.java:495)
at org.apache.fop.fonts.FontReader.startElement(FontReader.java:166)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.fop.fonts.FontReader.createFont(FontReader.java:91)
... 31 more
---------
org.xml.sax.SAXException: Missing metrics-version attribute - please regenerate the font metrics file with a more recent version of FOP.
at org.apache.fop.fonts.apps.TTFReader.checkMetricsVersion(TTFReader.java:495)
at org.apache.fop.fonts.FontReader.startElement(FontReader.java:166)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.fop.fonts.FontReader.createFont(FontReader.java:91)
at org.apache.fop.fonts.FontReader.<init>(FontReader.java:140)
at org.apache.fop.fonts.LazyFont.load(LazyFont.java:119)
at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:241)
at org.apache.fop.fonts.Font.getAscender(Font.java:106)
at org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:87)
at org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:120)
at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:69)
at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:216)
at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:692)
at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:149)
at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:132)
at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:337)
at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107)
at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238)
at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:261)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1399)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262)
at ExampleXML2PDF.main(ExampleXML2PDF.java:121)