diff --git a/PROMS/Volian.Print.Library/vlnChangeBar.cs b/PROMS/Volian.Print.Library/vlnChangeBar.cs index 979b850c..cc0613db 100644 --- a/PROMS/Volian.Print.Library/vlnChangeBar.cs +++ b/PROMS/Volian.Print.Library/vlnChangeBar.cs @@ -156,7 +156,17 @@ namespace Volian.Print.Library } public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) { + float? topMost = null; cb.SaveState(); + // for bug fix B2015-159 + // Ginna reported an instance where a change bar started printing inside the page header box + // in their Abnornal procedures AP-SG.1 step 41.b RNO which continued onto the next page + // calculate a new starting position for the change bar + if (_MyParent is vlnParagraph) + { + vlnParagraph pgh = _MyParent as vlnParagraph; + topMost = cb.PdfWriter.PageSize.Height - (float)pgh.MyItemInfo.MyDocStyle.Layout.TopMargin; + } VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; PdfLayer textLayer = _MyPageHelper == null ? null : _MyPageHelper.TextLayer; if (textLayer != null) cb.BeginLayer(textLayer); @@ -167,6 +177,10 @@ namespace Volian.Print.Library iTextSharp.text.Color changeBarColor = new iTextSharp.text.Color(PrintOverride.OverrideChangeBarColor(System.Drawing.Color.Black)); cb.SetColorStroke(changeBarColor); cb.SetLineWidth(.5F); + // for Bug Fix 2015-159 + // reset the YOffset if up too high before printing the change bar + if (topMost != null) + YOffset = Math.Min(YOffset, (float)topMost); cb.MoveTo(XOffset + xAdj, YOffset - yAdj); // combination yStart and YOffset cb.LineTo(XOffset + xAdj, YChangeBarBottomExtend - yAdj - 1); cb.Stroke();