From a9716e1bde4df8cda02fbe8daf0e5bdaba65cf3f Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 22 Sep 2011 11:54:12 +0000 Subject: [PATCH] --- PROMS/Volian.Print.Library/PromsPrinter.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index f5a0155c..8e88b3b4 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -442,6 +442,7 @@ namespace Volian.Print.Library if (textLayer != null) cb.EndLayer(); } private float _NoBreakYOffset = 0; + private float _NoBreakYPageStart = 0; private void CreateStepPdf(SectionInfo section, PdfContentByte cb) { iTextSharp.text.pdf.PdfWriter writer = cb.PdfWriter; @@ -456,8 +457,10 @@ namespace Volian.Print.Library Rtf2Pdf.Offset = new PointF(0, 2.5F); _MyHelper.ChangeBarDefinition = MyChangeBarDefinition; vlnParagraph myParagraph = new vlnParagraph(null, cb, myItemInfo, (float)myItemInfo.MyDocStyle.Layout.LeftMargin, _NoBreakYOffset, 0, myItemInfo.ColumnMode, myItemInfo.ActiveFormat); + float localYPageStart = 0; + float yPageStart = yTopMargin; if (myItemInfo.HasChildren) - myParagraph.ToPdf(cb, yTopMargin, yTopMargin, yBottomMargin); + localYPageStart = myParagraph.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); else PrintTextMessage(cb, "No Section Content", _TextLayer); SectionConfig.SectionPagination sp = SectionConfig.SectionPagination.Separate; // always the default @@ -483,10 +486,16 @@ namespace Volian.Print.Library { cb.PdfDocument.NewPage(); // end of step section _NoBreakYOffset = 0; + yPageStart = yTopMargin; } else { + float tmplocal = localYPageStart; _NoBreakYOffset = myParagraph.YBottomMost; + float yOffset = localYPageStart - yTopMargin; + _NoBreakYOffset -= yOffset; + yPageStart = localYPageStart; + Volian.Base.Library.DebugText.WriteLine("NOBREAK:{0},'{1}','{2}','{3}','{4}','{5}'", section.ItemID, tmplocal, yTopMargin, localYPageStart, _NoBreakYOffset, myParagraph.YBottomMost); } OnStatusChanged("StepSection converted to PDF " + section.ShortPath, PromsPrinterStatusType.BuildStep); }