0

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.

Massimiliano Kraus
  • 3,638
  • 5
  • 27
  • 47
Nafeez Abrar
  • 1,045
  • 10
  • 27

1 Answers1

2

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?

Bruno Lowagie
  • 75,994
  • 9
  • 109
  • 165
Joris Schellekens
  • 8,483
  • 2
  • 23
  • 54
  • And which has been answered, among other places, over here: https://stackoverflow.com/questions/10412401/how-to-read-an-embedded-resource-as-array-of-bytes-without-writing-it-to-disk – Amedee Van Gasse Aug 07 '17 at 07:22