Fixed error that caused file names to be in lower case when creating pdf

Created error handler to warn user when trying to view pdf file already open
This commit is contained in:
Rich
2013-04-10 14:23:14 +00:00
parent 1ad17cb080
commit a1e91b689d
2 changed files with 18 additions and 2 deletions

View File

@@ -128,7 +128,16 @@ namespace Volian.Print.Library
// Try to open a file for creating the PDF.
while (result == false)
{
string fileName = _FileName.ToLower().Replace(".pdf", suffix + ".pdf");
string fileName = _FileName;
int loc = fileName.IndexOf(".");
if (loc > -1)
{
string fname = fileName.Substring(0, loc);
fileName = fname + suffix + ".pdf";
}
else
fileName = fileName + suffix + ".pdf";
// string fileName = _FileName.ToLower().Replace(".pdf", suffix + ".pdf");
try
{
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(fileName, FileMode.Create));