From 4fe7c005b4aa13dcac841772af81dec68513f5af Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 4 Oct 2012 11:37:44 +0000 Subject: [PATCH] --- PROMS/Volian.Print.Library/vlnParagraph.cs | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 36442333..3608ef92 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -83,7 +83,7 @@ namespace Volian.Print.Library if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight); - vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo); + vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null); if (box != null && box.MyParent == null) { box.MyParent = para; @@ -121,7 +121,7 @@ namespace Volian.Print.Library { public override string ToString() { - return string.Format("{0} - {1} - '{2}'", this.YTop, this.YSize, this.MyItemInfo.ShortPath); + return string.Format("{0} - {1} - {2} - '{3}'", this.MyItemInfo.ItemID, this.YTop, this.YSize, this.MyItemInfo.ShortPath); } private vlnTable _MyGrid; public vlnTable MyGrid @@ -216,6 +216,7 @@ namespace Volian.Print.Library private void WCN_DrawBoxLines(PdfContentByte cb, ItemInfo ii, float yPageStart, float yTopMargin, float yBottomMargin, float yLocation) { if (!ii.IsStep || ii.IsCaution || ii.IsNote) return; + bool savedebug = Rtf2Pdf.PdfDebug; Rtf2Pdf.PdfDebug = false; System.Drawing.Font symbFont = new System.Drawing.Font("VESymbFix", 10); @@ -266,7 +267,8 @@ namespace Volian.Print.Library else { Paragraph horzLine = new Paragraph(ii.ActiveFormat.PlantFormat.FormatData.BoxList[0].BXHorz, iSymblFont); - bool bottomOfTable = ii.NextItem == null || ii.NextItemCount == 0; + bool bottomOfTable = (ii.NextItem == null || ii.NextItemCount == 0) || + (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.ItemID == ii.NextItem.ItemID); Box bx = ii.ActiveFormat.PlantFormat.FormatData.BoxList[0]; // if bottom of table use different cross/beg/end chars than if in middle of table. Paragraph leftLine = new Paragraph(bottomOfTable ? bx.BXLLC : bx.BXMLS, iSymblFont); @@ -590,7 +592,11 @@ namespace Volian.Print.Library // Now check if this is a template type step & if so, add the HLS's prefix/suffix to it. if (MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate) - yPageStart = this.MyParent.DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); + { + vlnParagraph smartPara = new vlnParagraph(MyParent.MyParent, cb, MyItemInfo.MyHLS, MyParent.XOffset, 0, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, " (continued)"); + float mytmpfloat = smartPara.ParagraphToPdf(cb, smartPara.Height, yTopMargin, yBottomMargin); // .ToPdf(cb, 0, yTopMargin, yBottomMargin); + yPageStart -= smartPara.Height; + } break; case 3: // Break on High Level Step (SevenLinesPerInch) if (!firstHighLevelStep) @@ -837,7 +843,7 @@ namespace Volian.Print.Library child.BuildLocationList(yTopMost, myLocations); } private int COL_WID_ADJ = 6; // adjusts for incorrect use of WidSTable when breaking a line (it breaks 6 chars too short) - public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo) + public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix) { int MetaLevel = 0; // if meta section, stores what level this section is. float savCheckListBottomMost = 0; @@ -857,7 +863,7 @@ namespace Volian.Print.Library if(MyTopRNO != null) MyTopRNO.LastRNO = this; } MyContentByte = cb; - MyPageHelper.MyParagraphs.Add(itemInfo.ItemID, this); + if (!MyPageHelper.MyParagraphs.ContainsKey(itemInfo.ItemID)) MyPageHelper.MyParagraphs.Add(itemInfo.ItemID, this); MyItemInfo = itemInfo; XOffset = xoff; if (!MyItemInfo.IsStep && !MyItemInfo.IsStepSection) @@ -1051,7 +1057,7 @@ namespace Volian.Print.Library } else { - Rtf = GetRtf(itemInfo); + Rtf = GetRtf(itemInfo, prefix, suffix); // Need the following with some modifications for WCNCKL format: if (Rtf.Contains("{Backspace}")) { @@ -1567,12 +1573,10 @@ namespace Volian.Print.Library (fixedAERChgCol % 100) : -fixedAERChgCol : -5; } private StringBuilder _RtfSB = null; - - // return rtf and use for tab and other text - public string GetRtf(ItemInfo itemInfo) + public string GetRtf(ItemInfo itemInfo, string prefix, string suffix) { _RtfSB = new StringBuilder(); - DisplayText vlntxt = new DisplayText(itemInfo, E_EditPrintMode.Print, E_ViewMode.View, true, E_FieldToEdit.StepText, false); + DisplayText vlntxt = new DisplayText(itemInfo, E_EditPrintMode.Print, E_ViewMode.View, true, E_FieldToEdit.StepText, false, prefix, suffix); System.Drawing.Font myFont = vlntxt.TextFont.WindowsFont; if (!itemInfo.IsTable && StepRTB.MyFontFamily != null) myFont = new System.Drawing.Font(StepRTB.MyFontFamily, myFont.Size, myFont.Style); @@ -2190,7 +2194,7 @@ namespace Volian.Print.Library { public override string ToString() { - return string.Format("{0} - {1} - '{2}'", this.StepLevel, this.YTop, this.MyParagraph.MyItemInfo.ShortPath); + return string.Format("{0} {1} - {2} - '{3}'", this.MyParagraph.MyItemInfo.ItemID, this.StepLevel, this.YTop, this.MyParagraph.MyItemInfo.ShortPath); } private float _YTop; public float YTop