We are using the Following fonts :-
1) Palatino Linotype
2) Palatino Linotype Bold
3) Palatino Linotype Bold Italic
4) Palatino Linotype Italic
These Fonts are installed on C:\Windows\Fonts directory.
The Code I am using is as follows :-
float x = pdf.Form.Fields[fieldName].GetX(page);
float y = pdf.Form.Fields[fieldName].GetY(page);
dataValue = "<b>Group life benefit:</b> a lump sum benefit payabale on death";
FontFamily fontFamily = new FontFamily(setting.FontName.Name, setting.FontName);
// Create an formatted style
FormattedTextAreaStyle style = new FormattedTextAreaStyle(fontFamily , setting.FontSize, false);
FormattedTextArea formattedTextArea = new FormattedTextArea(dataValue, x, y, pdf.Form.Fields[fieldName].Width, pdf.Form.Fields[fieldName].Height, style);
page.Elements.Add(formattedTextArea);
In this code the Font being used is "Palatino Linotype" and the
setting.FontName.Name = ""PalatinoLinotype-Roman"
When I change this code to the use FontFamily.Times then it works as expected:
FormattedTextAreaStyle style = new FormattedTextAreaStyle(FontFamily.Times , setting.FontSize, false);
Am I doing something wrong when using the "Palatino Linotype" font due to which the formatting does not work as expected.