From 98b84fdaf805a92a214f5909021d825d3e5809eb Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 7 May 2018 16:05:39 +0000 Subject: [PATCH] B2018-071 Don't crash when trying to convert an invalid word document to PDF B2018-069 Revert PDF Location to default temporary folder when running baseline testing --- PROMS/Volian.Print.Library/PromsPrinter.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 231c2eaa..f98f8fbc 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -533,6 +533,12 @@ namespace Volian.Print.Library NxtRCT = rct; MyContentByte.PdfDocument.NewPage(); } + private static bool _BaselineTesting = false; // Is the baseline being run (/P Commandline Parameter) + public static bool BaselineTesting + { + get { return PromsPrinter._BaselineTesting; } + set { PromsPrinter._BaselineTesting = value; } + } private iTextSharp.text.Rectangle NxtRCT = PageSize.LETTER; private SectionInfo GetNextSection(SectionInfo currentSection) { @@ -2329,8 +2335,9 @@ namespace Volian.Print.Library try { FileInfo fi = new FileInfo(MyPdfFile); - if (fi.Length == 0) // B2017-218 Handle invalid word sections + if (fi.Length == 0 ) // B2017-218 Handle invalid word sections { + if(!PromsPrinter.BaselineTesting) //B2018-071 Output a message box unless baseline testing is being performed. MessageBox.Show(si.DisplayNumber + " " + si.DisplayText + " is not valid", "Invalid Word Section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; }