- Replace slashes and backslashes with underscores in the pdf file name

- Use pdf name specified in the dialog
This commit is contained in:
Rich 2011-05-06 14:00:03 +00:00
parent ed8b4d11ee
commit 8aece0fb79

View File

@ -106,6 +106,14 @@ namespace Volian.Print.Library
private string _RevDate;
private ItemInfo _MyItem;
private string _Watermark;
private string _PDFFile;
public string PDFFile
{
get { return _PDFFile; }
set { _PDFFile = value; }
}
private bool _DebugOutput;
public bool DebugOutput
{
@ -138,7 +146,7 @@ namespace Volian.Print.Library
get { return _MyChangeBarDefinition; }
set { _MyChangeBarDefinition = value; }
}
public PromsPrinter(ItemInfo myItem, string rev, string revDate, string watermark, bool debugOutput, string backgroundFolder,bool openPDF, bool overWrite, ChangeBarDefinition cbd)
public PromsPrinter(ItemInfo myItem, string rev, string revDate, string watermark, bool debugOutput, string backgroundFolder,bool openPDF, bool overWrite, ChangeBarDefinition cbd, String pdfFile)
{
_MyItem = myItem;
_Rev = rev;
@ -149,6 +157,7 @@ namespace Volian.Print.Library
_OpenPDF = openPDF;
_OverWrite = overWrite;
_MyChangeBarDefinition = cbd;
_PDFFile = pdfFile;
}
public string Print(string pdfFolder)
{
@ -242,14 +251,14 @@ namespace Volian.Print.Library
}
private string FixFileName(string name)
{
return Regex.Replace(name, "[ .,]", "_") + ".pdf";
return Regex.Replace(name, "[ .,/]", "_") + ".pdf";
}
int _StepPageNumber = 0;
private VlnSvgPageHelper _MyHelper = null;
private string Print(ProcedureInfo myProcedure, string pdfFolder)
{
OnStatusChanged("Print " + myProcedure.DisplayNumber, PromsPrinterStatusType.Start);
string outputFileName = pdfFolder + "\\" + CreateFileName(myProcedure.DisplayNumber);
string outputFileName = pdfFolder + "\\" + PDFFile;
if (!OverWrite && File.Exists(outputFileName))
{
if (MessageBox.Show(outputFileName + " exists. Overwrite file?", "File Exists", MessageBoxButtons.YesNo) == DialogResult.No)