diff --git a/PROMS/Volian.Print.Library/vlnHeader.cs b/PROMS/Volian.Print.Library/vlnHeader.cs index 5c6910b6..c1347953 100644 --- a/PROMS/Volian.Print.Library/vlnHeader.cs +++ b/PROMS/Volian.Print.Library/vlnHeader.cs @@ -27,8 +27,13 @@ namespace Volian.Print.Library } public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) { + string fontFace = MyFont.WindowsFont.Name; + int fontStyle = (MyFont.WindowsFont.Bold ? iTextSharp.text.Font.BOLD : 0) + (MyFont.WindowsFont.Italic ? iTextSharp.text.Font.ITALIC : 0); + iTextSharp.text.Font itextFont = Volian.Svg.Library.Svg.GetFont(fontFace, MyFont.WindowsFont.Size, fontStyle, System.Drawing.Color.Black); + float hdrwidth = itextFont.BaseFont.GetWidthPoint(Text, MyFont.WindowsFont.Size); + hdrwidth += 1; float yLocation = CalculateYOffset(yPageStart, yTopMargin); - Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, HeaderWidth, 100, "", yBottomMargin); + Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, hdrwidth, 100, "", yBottomMargin); return yPageStart; } }