[英]HTML encoded letters in XSL-FO
我正在使用XSLT將XML轉換為XSL-FO,然后從中創建PDF(使用Apache FOP )。 不幸的是,我有XML編碼的HTML字母,例如:
<TAG>wpływ</TAG>
我該如何用Ł
代替ł
在我的輸出PDF中?
似乎未正確設置FOP的配置。 編輯或復制文件fop.xconf
,該文件將在FOP安裝目錄下的conf
文件夾中找到。
在此文件中,找到<renderer mime="application/pdf">
標記。 在<fonts>
子標記內,添加<auto-detect/>
。 您應該獲得這樣的<renderer>
配置(我已經刪除了所有注釋文本):
<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>
<!-- ... lots of commented stuff in here ... -->
<auto-detect/>
</fonts>
</renderer>
然后,您應該使用-c
選項調用fop命令,例如
fop -c path/to/file/fop.xconf myfile.fo myfileout.pdf
並且它應該可以正常工作(假設字體可以正確呈現特定字符)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.