diff --git a/PROMS/Volian.Print.Library/vlnBox.cs b/PROMS/Volian.Print.Library/vlnBox.cs index 2790a95d..ede8a9b1 100644 --- a/PROMS/Volian.Print.Library/vlnBox.cs +++ b/PROMS/Volian.Print.Library/vlnBox.cs @@ -47,9 +47,8 @@ namespace Volian.Print.Library //Console.WriteLine("'{0}','{1}'", CharToAsc(MyBox.BoxStyle), MyParent.MyItemInfo.ShortPath); float top = CalculateYOffset(yPageStart, yTopMargin) - (7*MyPageHelper.YMultiplier); float bottom = top - (Height * MyPageHelper.YMultiplier); - float leftmargin = (float)MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin + 3; - float left = (float)(MyBox.Start == null ? MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin : leftmargin + MyBox.Start); - float right = leftmargin + (float)(MyBox.End ?? DefEnd); + float left = (float)((MyBox.Start ?? 0) + MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin); + float right = (float)MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin + (float)(MyBox.End ?? DefEnd); iTextSharp.text.Color boxColor = new iTextSharp.text.Color(PrintOverride.OverrideBoxColor(System.Drawing.Color.Black)); cb.SetColorStroke(boxColor); if (DefBox != null) @@ -70,11 +69,13 @@ namespace Volian.Print.Library break; default: // For other than OHLP/HLP. For those not matching the HLP Boxes - throw new Exception("Missing vlnBox handler"); + Console.WriteLine("NO BOXES"); + break; + //throw new Exception("Missing vlnBox handler"); } const float llxOffset = 3; cb.SetLineWidth(lineThickness); - cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left - llxOffset, (Height - lineThickness) * MyPageHelper.YMultiplier); + cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier); } cb.Stroke(); if (textLayer != null) cb.EndLayer(); diff --git a/PROMS/Volian.Print.Library/vlnChangeBar.cs b/PROMS/Volian.Print.Library/vlnChangeBar.cs index 578aea47..f60ec5d6 100644 --- a/PROMS/Volian.Print.Library/vlnChangeBar.cs +++ b/PROMS/Volian.Print.Library/vlnChangeBar.cs @@ -168,7 +168,7 @@ namespace Volian.Print.Library } myparagraph.Alignment = MessageAlignment; myparagraph.Leading = iFont.Size; - float w = vlnPrintObject.GetTableWidth(cb, myparagraph); + float w = vlnPrintObject.GetTableWidth(cb, myparagraph, MyParent.MyItemInfo.MyDocStyle.Layout.PageWidth); float h = vlnPrintObject.GetParagraphHeight(cb, myparagraph, w); cb.SetColorFill(changeBarColor); Rtf2Pdf.TextAt(cb, myparagraph, XOffset + xAdj - Rtf2Pdf.Offset.X + 3, yBottom + h - Rtf2Pdf.Offset.Y + 2.7F, w, h, "", yBottomMargin); diff --git a/PROMS/Volian.Print.Library/vlnHeader.cs b/PROMS/Volian.Print.Library/vlnHeader.cs index 87a50fbc..5c6910b6 100644 --- a/PROMS/Volian.Print.Library/vlnHeader.cs +++ b/PROMS/Volian.Print.Library/vlnHeader.cs @@ -12,7 +12,7 @@ namespace Volian.Print.Library { public float HeaderWidth { - get { return _WidthAdjust + (_CharsToTwips * Text.Length); } + get { return _WidthAdjust + (MyFont.CharsToTwips * Text.Length); } } public vlnHeader(vlnParagraph myParent, PdfContentByte cb, string origStr, string cleanStr, float xoffset, float yoffset, VE_Font vFont) { diff --git a/PROMS/Volian.Print.Library/vlnMacro.cs b/PROMS/Volian.Print.Library/vlnMacro.cs index d243ef38..ef86e244 100644 --- a/PROMS/Volian.Print.Library/vlnMacro.cs +++ b/PROMS/Volian.Print.Library/vlnMacro.cs @@ -35,7 +35,10 @@ namespace Volian.Print.Library System.Drawing.Color push = PrintOverride.SvgColor; PrintOverride.SvgColor = PrintOverride.TextColor == System.Drawing.Color.Empty ? System.Drawing.Color.Black : PrintOverride.TextColor; if (MyPageHelper != null && MyPageHelper.MySvg != null) - MyPageHelper.MySvg.DrawMacro(MacroDef, XOffset, yLocation, cb); + { + // PageList items are located with respect to the left margin, macros are not. + MyPageHelper.MySvg.DrawMacro(MacroDef, XOffset - MyPageHelper.MySvg.LeftMargin, yLocation, cb); + } PrintOverride.SvgColor = push; if (textLayer != null) cb.EndLayer(); return yPageStart;