From f399ad350ac9999cf06ca14316590b03d0bc2d98 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 1 Feb 2013 14:59:30 +0000 Subject: [PATCH] --- PROMS/Volian.Print.Library/PromsPrinter.cs | 35 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 2031eed5..769c2b63 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -353,7 +353,6 @@ namespace Volian.Print.Library int finalMessageSectionID = GetFinalMessageSectionID(myProcedure, doingFoldout); foreach (SectionInfo mySection in myProcedure.Sections) { - if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT" || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT"))) != doingFoldout) continue; @@ -467,7 +466,8 @@ namespace Volian.Print.Library if (_MyHelper.MyTOCPageCounts.ContainsKey(tocKey)) { PageCount pc = _MyHelper.MyTOCPageCounts[tocKey]; - pc.Total = _MyHelper.CurrentPageNumber; + // add 1 because have not hit end page yet. + pc.Total = _MyHelper.CurrentTOCPageNumber + 1; pc.DrawTemplates(); } else @@ -479,9 +479,9 @@ namespace Volian.Print.Library { string tockey = "TOC" + mySection.ItemID.ToString(); if (!_MyHelper.MyTOCPageNums.ContainsKey(tockey)) - // increment the currentpagenumber by 1 since we haven't hit an + // increment the CurrentTOCPageNumber by 1 since we haven't hit an // endpage yet, and that's what increments it to the current page number. - _MyHelper.MyTOCPageNums.Add(tockey, _MyHelper.CurrentPageNumber+1); + _MyHelper.MyTOCPageNums.Add(tockey, _MyHelper.CurrentTOCPageNumber + 1); } } float origYoff = (float)mySection.MyDocStyle.Layout.TopMargin; @@ -641,12 +641,37 @@ namespace Volian.Print.Library yLocation += (lastyLocation - retval - vlnPrintObject.SixLinesPerInch); lastyLocation = retval; + // if the space character is not null & is not a space, the we've got to put out + // these between the section title & the page number + if (tOfC.TofCSpaceChar != null && tOfC.TofCSpaceChar != "" && tOfC.TofCSpaceChar != " ") + { + width = 0; + foreach (Chunk chkt in myparagrapht.Chunks) + width += chkt.GetWidthPoint(); + float startSpace = leftMargin + adjSecTitlePos + width; + float endSpace = leftMargin + secPagePos; + float numSpace = endSpace - startSpace; + string spaceStr = ""; + rtfText = GetRtfToC(tOfC.TofCSpaceChar, tOfC); + Paragraph tmpmyparagraph = vlnPrintObject.RtfToParagraph(rtfText); + float spacchrwid = 0; + foreach (Chunk chkt in tmpmyparagraph.Chunks) + spacchrwid += chkt.GetWidthPoint(); + while (numSpace > 0) + { + spaceStr = spaceStr + tOfC.TofCSpaceChar; + numSpace -= spacchrwid; + } + rtfText = GetRtfToC(spaceStr, tOfC); + Paragraph myparagraphs = vlnPrintObject.RtfToParagraph(rtfText); + retval = Rtf2Pdf.TextAt(cb, myparagraphs, startSpace, yPageStart - yLocation, endSpace - startSpace, height, "", yBottomMargin); + } // if in the pre-table of content list, just put the page number out as text. // otherwise, add a template _MyHelper.MyTOCPageCounts string key = "TOC" + mySection.ItemID.ToString(); if (mySection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key)) { - string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentPageNumber+1).ToString(); + string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentTOCPageNumber + 1).ToString(); rtfText = GetRtfToC(pnum, tOfC); Paragraph myparagraphp = vlnPrintObject.RtfToParagraph(rtfText); width = pnum.Length * 6;