如何使用PDFBox生成PDF,该PDFBox应该在同一页面中包含拉丁/亚洲/Arbian Charaters?

发布于 2025-02-12 18:48:06 字数 617 浏览 0 评论 0原文

几天以来,我尝试从数据提取中生产一个新的PDF文件,其中包含具有不同字体的值。我主要有拉丁字符,但是我的字符串列表中的某些名称是中文或西里尔等人物。

我在Google或Stackoverflow上花费了大量时间和精力,但仍然无法生产它(Glyphe问题)。 当前,我在Windows上,但将部署在Linux上,我使用PDFBox的2.0.26或3.0.0-RC1版本。

我设法加载TTF这样的加载:

PDType0Font.load(doc, File("src/main/resources/font/LiberationSans-Regular.ttf").inputStream(),false)

如果在任何情况下我都设置为嵌入式嵌入,我会发现CMAP的问题。

我还尝试加载TTC文件,但每次都失败了。

我已经开始实现此解决方案 link ,但我不设法init Init Init /正确加载我的字体

您有任何想法吗?

最好,垫子

I try since few days to produce a new pdf file with pdfbox from a data extraction which contains values with different fonts. I have mainly latin characters but some names in my list of strings are in chinese or cyrillic, etc, characters.

I have spent lots of time and energy on google or stackoverflow but still don t manage to produce it(glyphe issue).
Currently, I m on Windows but will be deployed on Linux, and I use the version 2.0.26 or 3.0.0-RC1 of pdfbox.

I m manage to load ttf like that:

PDType0Font.load(doc, File("src/main/resources/font/LiberationSans-Regular.ttf").inputStream(),false)

if I set true to embedded in any cases, I got an issue of cmap.

I also tried to load ttc files but failed each time.

I have already started to implement this solution link but I don t manage to init/load correctly my font

Do you have any idea to do it?

Best, Mat

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文