title: Loading BaseFont from embedded resource in iTextSharp
body: <p>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.</p>
  
  <p>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.</p>
  
  <pre><code>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));
  </code></pre>
  
  <p>Can anybody help me as to how I might achieve this?</p>