From 056a4a9e04525c89473e3d71f9ff430301293fa0 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 21 Nov 2011 20:51:39 +0000 Subject: [PATCH] Fix page numbering handle NullBox (MyBox == null) --- PROMS/Volian.Print.Library/PromsPrinter.cs | 4 +++- PROMS/Volian.Print.Library/vlnBox.cs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index cc652b8d..77ac1258 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -388,9 +388,10 @@ namespace Volian.Print.Library } for (int ii = 0; ii < sectPageCount; ii++) { + int pageNumber = 1 + ii; + //mySection.PageNumForDocStyle = pageNumber; if (((mySection.MyDocStyle.StructureStyle.Style ?? 0) & E_DocStructStyle.UseSectionFoldout) != 0) DoFoldoutPage(cb, "Word Document", _TextLayer, _MyHelper); - int pageNumber = 1 + ii; if (readerWord != null) { bool doimport2 = true; @@ -474,6 +475,7 @@ namespace Volian.Print.Library private float _NoBreakYPageStart = 0; private void CreateStepPdf(SectionInfo section, PdfContentByte cb) { + //section.PageNumForDocStyle = 1; // first step of the section iTextSharp.text.pdf.PdfWriter writer = cb.PdfWriter; ItemInfo myItemInfo = section as ItemInfo; // 792: 72 * 11 inches - TopRow - Top is high value diff --git a/PROMS/Volian.Print.Library/vlnBox.cs b/PROMS/Volian.Print.Library/vlnBox.cs index a7f35d73..061f8f16 100644 --- a/PROMS/Volian.Print.Library/vlnBox.cs +++ b/PROMS/Volian.Print.Library/vlnBox.cs @@ -43,6 +43,7 @@ namespace Volian.Print.Library const string BoxFPLCaution = "\x2588.\x2580.\x2588.\x2588. . .\x2588.\x2588. .\x2584. . "; public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) { + if (MyBox == null) return yPageStart; cb.SaveState(); VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; PdfLayer textLayer = _MyPageHelper == null ? null : _MyPageHelper.TextLayer;