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));