iTextSharp really, really doesn't like it when I try to create Fonts:
FontFactory.GetFont(Font.HELVETICA, 12)
This gives me a user-friendly StackOverflowException
. So I tried this:
new Font(Font.HELVETICA, 12)
which does the same thing. Tried Font.TIMES
, and got the same thing, too. So I tried dropping a bit lower based on this answer, which suggests the following:
BaseFont bf = BaseFont.CreateFont(
HttpContext.Current.Server.MapPath("/path/to/times.ttf"),
BaseFont.IDENTITY_H,
BaseFont.EMBEDDED);
new Font(bf, 12);
Once again, StackOverflowException
. While the consistency is nice, I'd prefer that the library would let me select a font.
I'm sure I've just got some configuration wrong somewhere; but it escapes me as to what it could be.