When using the right alignment options on grid cells or drawstring adding a £ symbol anywhere on the line it appears to add an extra space to the end of the line, so it is no longer right aligned. If I use a $ symbol is works fine, so it appears to be just the £ symbol with the issue.
Sample code to reproduce.
- Code: Select all
PdfDocument document = new PdfDocument();
document.Pages.Add();
PdfPageBase page = document.Pages[0];
RectangleF rctg1 = new RectangleF(x, y, 280, 712);
RectangleF rctg2 = new RectangleF(x, y+80, 280, 712);
//works as expected
page.Canvas.DrawString( "Hello \nWorld", arialNormal, mainBrush, rctg1,new PdfStringFormat() { Alignment = PdfTextAlignment.Right});
//alignment not correct
page.Canvas.DrawString("Hello \n£World", arialNormal, mainBrush, rctg2, new PdfStringFormat() { Alignment = PdfTextAlignment.Right });
Can you suggest a workaround or fix?
Thanks
Andy