From 98a1eb3de45b425937e8ee21c12389383c77dd43 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 26 Oct 2012 10:33:36 +0000 Subject: [PATCH] --- PROMS/Volian.Print.Library/vlnHeader.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } }