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,433
  • 5
  • 24
  • 45
Nafeez Abrar
  • 985
  • 9
  • 26

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
  • 73,590
  • 10
  • 107
  • 159
Joris Schellekens
  • 7,863
  • 1
  • 21
  • 50
  • 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