Nafeez Abrar
Nafeez Abrar

Reputation: 1075

How to load a font directly from an embedded resource with iText7 on .net

I have found a method to load a font from a file using a font factory. But how should I go about loading a file directly from embedded source of dll, without creating a physical file in iText 7.

Upvotes: 0

Views: 863

Answers (1)

Joris Schellekens
Joris Schellekens

Reputation: 9012

PdfFontFactory has following method:

createFont(byte[] fontProgram, boolean embedded)
Creates a PdfFont instance by the bytes of the underlying font program.

So your question is basically "How do I get the byte[] from a resource in a dll", which has nothing to do with iText anymore, and which is a question that was already answered on Stack Overflow: How to Read an embedded resource as array of bytes without writing it to disk?

Upvotes: 2

Related Questions