CFDocument PDF不显示日语数据 [英] CFDocument PDF not showing Japanese data
问题描述
我使用CFDocument创建了一个包含日语内容的pdf文件.但是它没有显示日语数据.我已经将pageEncoding用作utf-8.它只显示空格,而不显示日语数据.
I have created a pdf with Japanese content using CFDocument. But It does not showing the Japanese data. I have used pageEncoding as utf-8. It showing only blank space instead of Japanese data.
我使用了以下代码,
<cfcontent type="application/pdf">
<cfheader name="Content-Disposition" value="attachment;filename=test.pdf">
<cfprocessingdirective pageencoding="utf-8">
<cfdocument format="PDF" localurl="yes" marginTop=".25" marginLeft=".25" marginRight=".25" marginBottom=".25" pageType="custom" pageWidth="8.5" pageHeight="10.2">
<cfoutput>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PDF Export Example</title>
<style>
body { font-family: Verdana; }
</style>
</head>
<body>
<h1>PDF Export Example</h1>
<p>担当するクライエントの大半は様々な規模の企業だが、カナダの大学や政府関連の研究機関の担当経験もある。
</p>
<h1>PDF Export English Example</h1>
<p>This is an example.
</p>
</body>
</html>
</cfoutput>
</cfdocument>
请帮助!
推荐答案
在PDF中使用Verdana的实现似乎不支持中文/日语.但是,它看起来像 MingLiU
一样.我只是将其更改为使用该字体,并且一切都可以通过ColdFusion 10正常运行.它在Railo中仍然不起作用,但是我认为这是Railo的问题,而不是PDF/字体问题.
It seems Verdana's implementation when used in PDF doesn't support Chinese / Japanese. However it looks like MingLiU
does. I just changed it to use that font, and everything worked OK via ColdFusion 10. It still didn't work in Railo, but I assume that's a Railo problem, not a PDF / font problem.
因此,无论如何,只要使用专门支持您需要渲染的字形的字体即可.
So, anyway, just use a font that specifically supports the glyphs you need to render.
这篇关于CFDocument PDF不显示日语数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!