From c65d3e8cdfbd3e41a82751afb96fd69f366ce3bc Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 9 Mar 2015 13:13:45 +0000 Subject: [PATCH] Fixed logic when ParaBreak is null Fixed logic when PDF is open --- PROMS/Volian.Print.Library/Pagination.cs | 2 +- PROMS/Volian.Print.Library/PromsPrinter.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 7c613d1a..17af1d69 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -949,7 +949,7 @@ namespace Volian.Print.Library } } } - if (paraBreak.PageBreakReason == null) + if (paraBreak != null && paraBreak.PageBreakReason == null) paraBreak.PageBreakReason = "Rest of Step fits at 6 LPI"; ProfileTimer.Pop(profileDepth); } diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index ef1bd609..ccb20f02 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -440,12 +440,12 @@ namespace Volian.Print.Library // Setup a pdf Document for printing OnStatusChanged("Before OpenDoc", PromsPrinterStatusType.Before); PdfContentByte cb = OpenDoc(outputFileName); - SetupProperties(cb.PdfDocument, myProcedure); if (cb == null) { ProfileTimer.Pop(profileDepth); return null; } + SetupProperties(cb.PdfDocument, myProcedure); OnStatusChanged("Before NewPage", PromsPrinterStatusType.Before); cb.PdfDocument.NewPage(); // Start of print //_MyLog.InfoFormat("NewPage 1 {0}", cb.PdfWriter.CurrentPageNumber);