I am using iTextSharp to generate dynamic PDF documents. I have a requirement to use a very specific font for which I have the licensed .ttf file.
I can use the code the below to load and use the font, however I would much prefer to have the font file as located as an embedded resource in my class library rather than being reliant on a specific location on disk.
string fontpath = Server.MapPath(".");
BaseFont customfont = BaseFont.CreateFont(fontpath + "myspecial.ttf", BaseFont.CP1252, BaseFont.EMBEDDED);
Font font = new Font(customfont, 12);
string s = "My expensive custom font.";
doc.Add(new Paragraph(s, font));
Can anybody help me as to how I might achieve this?