以编程方式将字体嵌入到docx4j中的文档中(在XHTML-DOCX转换期间) [英] Programmatically embed fonts to document in docx4j (during XHTML - DOCX conversion)

查看:70
本文介绍了以编程方式将字体嵌入到docx4j中的文档中(在XHTML-DOCX转换期间)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在查找手册和搜索docx4J的源代码时,我还没有找到以编程方式将我的自定义字体嵌入输出文档中的解决方案.(xhtml-docx转换)

Looking in manual and searching in sources of docx4J I haven't found the solution to programmatically embed my custom font in output document. (xhtml-docx conversion)

因此,我发现一些类可以处理docx中已经嵌入的字体(例如在docx-pdf转换期间),但是找不到首先将其嵌入的方法.

So, I've found some classes which manipulate already embedded fonts in docx (for example during docx - pdf conversion), but can not find how to embed them at the first place.

也许还有另一个执行此任务的库.

Maybe there is another library for such task.

(使用Microsoft Word手动嵌入是不合适的解决方案)谢谢.

(Manual embedding with Microsoft Word is not suitable solution) Thanks.

推荐答案

两个主要步骤.

首先,添加一个包含字体的ObfuscatedFontPart.您将需要

First, add an ObfuscatedFontPart containing your font. You'll need the reverse of the deObfuscate method to do this.

第二,您可能需要 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆