I am trying to embed a font using itextsharp 5.2.1.0, but am getting errors. the font is KozGoPro-Light.otf which after doing a bit of research is a japenese font. I have tried the following...
Dim tblx1 As PdfPTable = New PdfPTable(1)
Dim tblrightcell_margin2 As PdfPCell
Dim bfR As iTextSharp.text.pdf.BaseFont
**bfR = iTextSharp.text.pdf.BaseFont.CreateFont("KozGoPro-Light.otf", iTextSharp.text.pdf.BaseFont.IDENTITY_H, iTextSharp.text.pdf.BaseFont.EMBEDDED)
fntKozgoProExtra = New Font(bfR, 18)**
tblrightcell_margin2 = New PdfPCell(New Phrase("testing....", fntKozgoProExtra))
tblx1.AddCell(tblrightcell_margin2)
When i try add the font to a phrase, it will say Object reference not set to an instance of an object. If I change iTextSharp.text.pdf.BaseFont.IDENTITY_H to CP1252 or any of those encodings it will just show incorrectly on the pdf. Any clues?