I use fop Quick Guide to print a simple PDF file from a simple XML file, and it works great. but when I change <name>Frank</name> to <name>Ψ§Ω
ΫΨ±Ψ±ΨΆΨ§</name> (change the name to a different encoding), I get #### in my printed PDF. I browse over the Internet and have not found an acceptable solution. I use a lot of configuration files, here are some of my configuration files:
I use this command to create pdf:
fop -c cfg.xml -xml name.xml -xsl name2fo.xsl -pdf name.pdf
When I use this command, I get the warning below:
WARNING: xHeight value could not be determined. The font may not work as Sep 15, 2011 9:15:37 AM org.apache.fop.events.LoggingEventListener proce WARNING: Glyph "β" (0x633, afii57427) not available in font "Helvetica". Sep 15, 2011 9:15:37 AM org.apache.fop.events.LoggingEventListener proce WARNING: Glyph "β" (0x634, afii57428) not available in font "Helvetica".
1- name.xml contains:
<name>Ψ§Ω
ΫΨ±Ψ±ΨΆΨ§</name>
2-name2fo.xsl contains:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="A4-portrait" page-height="29.7cm" page-width="21.0cm" margin="2cm"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4-portrait"> <fo:flow flow-name="xsl-region-body"> <fo:block> Hello, <xsl:value-of select="name"/>! </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> </xsl:stylesheet>
3- try a lot of different configuration files (cfg.xml).
3.1
<fop version="1.0"> <renderers> <renderer mime="application/pdf"> <fonts> <substitutions> <substitution> <from font-family="Helvetica" /> <to font-family="SansSerif"/> </substitution> </substitutions> <referenced-fonts> <match font-family=".*"/> </referenced-fonts> <directory recursive="true">G:\....\fop\fop-1.0\Core14_AFMs</directory> <auto-detect/> <font embed-url="C:\WINDOWS\Fonts\times.ttf"> <font-triplet name="Times New Roman" style="normal" weight="normal"/> </font> </fonts> </renderer> </renderers> </fop>
3.2
<fop version="1.0"> <renderers> <renderer mime="application/pdf"> <fonts> <substitutions> <substitution> <from font-family="Helvetica" /> <to font-family="SansSerif"/> </substitution> </substitutions> <referenced-fonts> <match font-family=".*"/> </referenced-fonts> <auto-detect/> </fonts> </renderer> </renderers> </fop>
3.3: ......
Result of the result:
Hello, #######!
Can someone help me fix this?
source share