简体   繁体   English

如何在OpenXML Word文档中嵌入字体文件

[英]How to embed font file in OpenXML Word document

I'm building a Word document in OpenXML with C#. 我正在使用C#在OpenXML中构建Word文档。

One of the fonts I must use is a custom-made branded font. 我必须使用的一种字体是定制的品牌字体。 This font will not be available on customer machines. 此字体在客户计算机上将不可用。

Is it possible to embed font-file within .docx file and reference that font in font styles. 是否可以在.docx文件中嵌入字体文件并以字体样式引用该字体。 If yes, how can this be done within C# SDK? 如果是,该如何在C#SDK中完成?

So far that does not seem to be possible, but I might have missed the documentation page somewhere. 到目前为止,这似乎是不可能的,但是我可能已经错过了文档页面。

ps I already have PDF with embedded fonts. ps我已经有了嵌入字体的PDF。 Now I need the same looking Word document. 现在,我需要外观相同的Word文档。

Sounds like what you need is a .pdf . 听起来您需要的是.pdf So unless it absolutely must be a .docx I think that's your best option. 因此,除非绝对必须是.docx,否则我认为这是您的最佳选择。

Help on generating a .pdf in C# can be found here . 在C#中生成.pdf的帮助可以在此处找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM