如何使用 .net 上的 iText7 直接从嵌入式资源加载字体
How to load a font directly from an embedded resource with iText7 on .net
我找到了一种使用字体工厂从文件加载字体的方法。但是我应该如何直接从嵌入式 dll 源加载文件,而不在 iText 7 中创建物理文件。
PdfFontFactory 有以下方法:
createFont(byte[] fontProgram, boolean embedded)
Creates a PdfFont instance by the bytes of the underlying font program.
所以你的问题基本上是 "How do I get the byte[] from a resource in a dll",这与 iText 不再有任何关系,而且这个问题已经在 Stack Overflow 上得到了回答:How to Read an embedded resource as array of bytes without writing it to disk?
我找到了一种使用字体工厂从文件加载字体的方法。但是我应该如何直接从嵌入式 dll 源加载文件,而不在 iText 7 中创建物理文件。
PdfFontFactory 有以下方法:
createFont(byte[] fontProgram, boolean embedded)
Creates a PdfFont instance by the bytes of the underlying font program.
所以你的问题基本上是 "How do I get the byte[] from a resource in a dll",这与 iText 不再有任何关系,而且这个问题已经在 Stack Overflow 上得到了回答:How to Read an embedded resource as array of bytes without writing it to disk?