首页 > 解决方案 > ABCpdf unicode 字符为?

问题描述

我正在使用 ABCPDF 版本 9.1.2.5

我们创建 PDF 的过程就像在后台导航 URL 并以字符串形式获取完整的 HTML 我们使用 AddImageHtml() 方法创建 PDF,它可以与英语完美配合,但不适用于其他语言,如中文日语表示为“?” 标记

Dim PDFData() As Byte = Nothing
Dim HtmlPage As String
Dim PDFDoc As New Doc
PDFDoc.Font = PDFDoc.EmbedFont("Arial Unicode MS", LanguageType.Unicode, False, True)
HtmlPage = myclass.GetWebPageAsString(TargetURL, PostData)
If Orientation = Myclass.PDFOrientation.Landscape Then
 Width = PDFDoc.MediaBox.Width
 Height = PDFDoc.MediaBox.Height
 Left = PDFDoc.MediaBox.Left
 Bottom = PDFDoc.MediaBox.Bottom
 PDFDoc.Transform.Rotate(90, Left, Bottom)
 PDFDoc.Transform.Translate(Width, 0)
 PDFDoc.Rect.Width = Height
 PDFDoc.Rect.Height = Width
End If
PDFDoc.Rect.Inset(20, 20)
PDFDoc.HtmlOptions.Timeout = 3600000
PDFDocID = PDFDoc.AddImageHtml(HtmlPage)
PDFData = PDFDoc.GetData
PDFDoc.Clear()

标签: abcpdf

解决方案


您使用的 ABCpdf 版本已于 2015 年初停用。您使用的默认引擎的 CJK 字符呈现取决于您运行应用程序的计算机上安装的 Internet Explorer 版本。从版本 11 开始,现在可以使用 Chrome 引擎,它对您的操作系统配置的依赖性大大降低。它也更快,更符合标准。


推荐阅读