diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index fe8a2571..053543ba 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -204,7 +204,7 @@ namespace Volian.Print.Library { // see if there is an end message. This is stored in the helper - if there is, // we need to be sure that there is room for it. - if (MyPageHelper.BottomMessage != null) + if (MyPageHelper.BottomMessage != null && MyPageHelper.BottomMessage.Count != 0) { if (mySize + yEndMsg <= yWithinMargins) return 1; } diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 7235112a..bc638180 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -1736,7 +1736,7 @@ namespace Volian.Print.Library { if (nxtItem != null && nxtItem.MyPrevious != null && nxtItem.ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Level0Big) localYPageStart -= 12; - if (_MyHelper.BottomMessage != null) + if (_MyHelper.BottomMessage != null && _MyHelper.BottomMessage.Count != 0) { _MyHelper.DrawBottomMessage(cb); localYPageStart += 12; diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index fb162844..600ee193 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -85,8 +85,8 @@ namespace Volian.Print.Library get { return _TopMessageSub2s; } set { _TopMessageSub2s = value; } } - private vlnText _BottomMessage; - public vlnText BottomMessage + private List _BottomMessage = new List(); // B2017-203) any continuous sections with end messages may have more than 1 message on a page + public List BottomMessage { get { return _BottomMessage; } set { _BottomMessage = value; } @@ -749,10 +749,13 @@ namespace Volian.Print.Library } TopMessageSub2s = null; // Only output it once. } - if (BottomMessage != null) + if (BottomMessage != null && BottomMessage.Count != 0) { - BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp); - BottomMessage = null; // Only output it once. + foreach (vlnText vts3 in BottomMessage) + { + vts3.ToPdf(cb, 0, ref tmp, ref tmp); + } + BottomMessage.Clear(); // Only output it once. } if (BottomMessageR != null) { @@ -768,10 +771,13 @@ namespace Volian.Print.Library public void DrawBottomMessage(PdfContentByte cb) { float tmp = 0; - if (BottomMessage != null) + if (BottomMessage != null && BottomMessage.Count != 0) { - BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp); - BottomMessage = null; // Only output it once. + foreach (vlnText vts in BottomMessage) + { + vts.ToPdf(cb, 0, ref tmp, ref tmp); + } + BottomMessage.Clear(); // Only output it once. } } private void DrawChangeBars(PdfContentByte cb) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 6edb1e9d..b68fa68d 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -2119,7 +2119,7 @@ namespace Volian.Print.Library { ShowPageBreak(1, CheckForCompression("PageBreakOnStep/Caution/Note HLS"), "Yes", YTop - YBottomMost, yTopMargin - yBottomMargin, yTopMargin - yBottomMargin, false); YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - MyPageHelper.BottomMessage = null; + MyPageHelper.BottomMessage.Clear(); MyPageHelper.TopMessage = null; MyPromsPrinter.NewPage(); if (CompressPartOfStep) @@ -2213,16 +2213,17 @@ namespace Volian.Print.Library if ((docstyle.End.Margin ?? 0) != 0) { xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin; - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font); + MyPageHelper.BottomMessage.Add(new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font)); } else { // Center the bottom message float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2; xpos = Math.Max(xpos, XOffsetBox + (float)docstyle.Layout.LeftMargin); - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font); - MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height)); - yPageStart -= (MyPageHelper.BottomMessage.Height + adjMsgY); + vlnText vttmp = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font); + MyPageHelper.BottomMessage.Add(vttmp); + MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - vttmp.Height)); + yPageStart -= (vttmp.Height + adjMsgY); } } } @@ -2858,10 +2859,10 @@ namespace Volian.Print.Library else xoffB = docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0; //MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, docstyle.Continue.Bottom.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xoffB, msg_yLocation, docstyle.Continue.Bottom.Font); + MyPageHelper.BottomMessage.Add(new vlnText(cb, this, myMsg, myMsg, xoffB, msg_yLocation, docstyle.Continue.Bottom.Font)); } } - if (PageBreakOnStep) MyPageHelper.BottomMessage = null; + if (PageBreakOnStep) MyPageHelper.BottomMessage.Clear(); } private void RefreshDocStyle()