If header includes leading spaces, include those in size of header (AEP has spaces in front of OR

Use ‘RNOWidthAltAll’ (for AEP)
This commit is contained in:
2015-04-10 13:54:18 +00:00
parent 32acf4ac5a
commit dd49a26ef3
2 changed files with 13 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ namespace Volian.Print.Library
{
public partial class vlnHeader: vlnText
{
private string _OrigStr;
public float HeaderWidth
{
get { return _WidthAdjust + (MyFont.CharsToTwips * Text.Length); }
@@ -21,6 +22,7 @@ namespace Volian.Print.Library
YOffset = yoffset;
Width = MyParent.Width;
Text = cleanStr;
_OrigStr = (origStr.StartsWith(" ") && !origStr.Contains(@"\"))?origStr:null;
Rtf = GetRtf(origStr, vFont);
XOffset = xoffset;
MyFont = vFont;
@@ -31,6 +33,7 @@ namespace Volian.Print.Library
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);
if (_OrigStr != null) hdrwidth = itextFont.BaseFont.GetWidthPoint(_OrigStr, MyFont.WindowsFont.Size);
hdrwidth += 5;
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, hdrwidth, 100, "", yBottomMargin);