abcpdf - 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 版本已于 2015 年初停用。您使用的默认引擎的 CJK 字符呈现取决于您运行应用程序的计算机上安装的 Internet Explorer 版本。从版本 11 开始,现在可以使用 Chrome 引擎,它对您的操作系统配置的依赖性大大降低。它也更快,更符合标准。
推荐阅读
- python - 导入数据类型为浮点数和索引类型为字符串的 .csv
- amazon-web-services - 从 jenkins 动态地将容器图像值传递给 AWS cloudformation 模板
- python-3.x - 在 Django Rest Framework 中生成二维码并将二维码图像保存到 AWS S3
- excel - excel可以自动加减法吗
- flutter - 我应该如何在颤振应用程序中管理登录页面
- scala - 是否可以对返回 ZIO 的方法进行尾递归?
- c# - 任务锁定 MVVM WPF 项目上的 UI
- python - How to setattr to instance such that self is passed?
- swift - 在 SwiftUI 中用另一个 @State 属性值初始化 @State 属性
- apache-kafka - 卡夫卡生产者处理失去与经纪人的联系