From b173a28f3223f7f806e23f8c4d2f508248fcfa5c Mon Sep 17 00:00:00 2001 From: John Date: Thu, 1 Oct 2015 14:20:48 +0000 Subject: [PATCH] =?UTF-8?q?bug=20fix=20B2015-159=20=E2=80=93=20fixed=20iss?= =?UTF-8?q?ue=20where=20a=20change=20bar=20on=20a=20step=20that=20was=20co?= =?UTF-8?q?ntinued=20to=20next=20page,=20started=20printing=20in=20the=20p?= =?UTF-8?q?age=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Print.Library/vlnChangeBar.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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();