From 72eaac478ffaf7ca7feecf759bec65b1965848d6 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 4 Apr 2024 15:45:44 -0400 Subject: [PATCH] B2024-021 --- PROMS/Volian.Print.Library/PromsPrinter.cs | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 61b32bc1..82f950c3 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -701,22 +701,24 @@ namespace Volian.Print.Library { if (File.Exists(outputFileName)) { - String tmpExt = System.IO.Path.GetExtension(outputFileName); - String tmpPTH = System.IO.Path.GetDirectoryName(outputFileName); - String tmpFN = System.IO.Path.GetFileName(outputFileName); - String tmpFNNoExt = System.IO.Path.GetFileNameWithoutExtension(outputFileName); - - var files = new HashSet(Directory.GetFiles(tmpPTH, "*.pdf")); - //string baseName = Path.Combine(scpath, "Screenshot_"); - string filename; - int i = 0; - do + if (!BaselineTesting) { - filename = tmpPTH + @"\" + tmpFNNoExt + "_" + ++i + ".pdf"; - } while (files.Contains(filename)); + String tmpExt = System.IO.Path.GetExtension(outputFileName); + String tmpPTH = System.IO.Path.GetDirectoryName(outputFileName); + String tmpFN = System.IO.Path.GetFileName(outputFileName); + String tmpFNNoExt = System.IO.Path.GetFileNameWithoutExtension(outputFileName); - outputFileName = filename; + var files = new HashSet(Directory.GetFiles(tmpPTH, "*.pdf")); + //string baseName = Path.Combine(scpath, "Screenshot_"); + string filename; + int i = 0; + do + { + filename = tmpPTH + @"\" + tmpFNNoExt + "_" + ++i + ".pdf"; + } while (files.Contains(filename)); + outputFileName = filename; + } } writer = PdfWriter.GetInstance(document, new FileStream(outputFileName, FileMode.Create));