- Replace slashes and backslashes with underscores in the pdf file name
- Use pdf name specified in the dialog
This commit is contained in:
parent
ed8b4d11ee
commit
8aece0fb79
@ -106,6 +106,14 @@ namespace Volian.Print.Library
|
|||||||
private string _RevDate;
|
private string _RevDate;
|
||||||
private ItemInfo _MyItem;
|
private ItemInfo _MyItem;
|
||||||
private string _Watermark;
|
private string _Watermark;
|
||||||
|
private string _PDFFile;
|
||||||
|
|
||||||
|
public string PDFFile
|
||||||
|
{
|
||||||
|
get { return _PDFFile; }
|
||||||
|
set { _PDFFile = value; }
|
||||||
|
}
|
||||||
|
|
||||||
private bool _DebugOutput;
|
private bool _DebugOutput;
|
||||||
public bool DebugOutput
|
public bool DebugOutput
|
||||||
{
|
{
|
||||||
@ -138,7 +146,7 @@ namespace Volian.Print.Library
|
|||||||
get { return _MyChangeBarDefinition; }
|
get { return _MyChangeBarDefinition; }
|
||||||
set { _MyChangeBarDefinition = value; }
|
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;
|
_MyItem = myItem;
|
||||||
_Rev = rev;
|
_Rev = rev;
|
||||||
@ -149,6 +157,7 @@ namespace Volian.Print.Library
|
|||||||
_OpenPDF = openPDF;
|
_OpenPDF = openPDF;
|
||||||
_OverWrite = overWrite;
|
_OverWrite = overWrite;
|
||||||
_MyChangeBarDefinition = cbd;
|
_MyChangeBarDefinition = cbd;
|
||||||
|
_PDFFile = pdfFile;
|
||||||
}
|
}
|
||||||
public string Print(string pdfFolder)
|
public string Print(string pdfFolder)
|
||||||
{
|
{
|
||||||
@ -242,14 +251,14 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
private string FixFileName(string name)
|
private string FixFileName(string name)
|
||||||
{
|
{
|
||||||
return Regex.Replace(name, "[ .,]", "_") + ".pdf";
|
return Regex.Replace(name, "[ .,/]", "_") + ".pdf";
|
||||||
}
|
}
|
||||||
int _StepPageNumber = 0;
|
int _StepPageNumber = 0;
|
||||||
private VlnSvgPageHelper _MyHelper = null;
|
private VlnSvgPageHelper _MyHelper = null;
|
||||||
private string Print(ProcedureInfo myProcedure, string pdfFolder)
|
private string Print(ProcedureInfo myProcedure, string pdfFolder)
|
||||||
{
|
{
|
||||||
OnStatusChanged("Print " + myProcedure.DisplayNumber, PromsPrinterStatusType.Start);
|
OnStatusChanged("Print " + myProcedure.DisplayNumber, PromsPrinterStatusType.Start);
|
||||||
string outputFileName = pdfFolder + "\\" + CreateFileName(myProcedure.DisplayNumber);
|
string outputFileName = pdfFolder + "\\" + PDFFile;
|
||||||
if (!OverWrite && File.Exists(outputFileName))
|
if (!OverWrite && File.Exists(outputFileName))
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(outputFileName + " exists. Overwrite file?", "File Exists", MessageBoxButtons.YesNo) == DialogResult.No)
|
if (MessageBox.Show(outputFileName + " exists. Overwrite file?", "File Exists", MessageBoxButtons.YesNo) == DialogResult.No)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user