This commit is contained in:
@@ -27,10 +27,18 @@ namespace VEPROMS
|
||||
set { _MyPromsPrinter = value; }
|
||||
}
|
||||
|
||||
private bool _OpenPDF;
|
||||
|
||||
public bool OpenPDF
|
||||
{
|
||||
get { return _OpenPDF; }
|
||||
set { _OpenPDF = value; }
|
||||
}
|
||||
public frmPDFStatusForm(ItemInfo myItem, string rev, string revDate, string watermark, bool debugOutput, string backgroundFolder, bool openPDF, string pdfPath)
|
||||
{
|
||||
OpenPDF = openPDF;
|
||||
InitializeComponent();
|
||||
MyPromsPrinter = new PromsPrinter(myItem, rev, revDate, watermark, debugOutput, backgroundFolder, openPDF);
|
||||
MyPromsPrinter = new PromsPrinter(myItem, rev, revDate, watermark, debugOutput, backgroundFolder, false);//openPDF);
|
||||
PDFPath = pdfPath;
|
||||
this.Text = "Creating PDF of " + myItem.DisplayNumber;
|
||||
|
||||
@@ -60,16 +68,36 @@ namespace VEPROMS
|
||||
tmrRun.Enabled = true;
|
||||
}
|
||||
|
||||
private string _PdfFile;
|
||||
|
||||
private void tmrRun_Tick(object sender, EventArgs e)
|
||||
{
|
||||
tmrRun.Enabled = false;
|
||||
MyPromsPrinter.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged);
|
||||
DateTime tStart = DateTime.Now;
|
||||
string pdfFile = MyPromsPrinter.Print(PDFPath);
|
||||
_PdfFile = MyPromsPrinter.Print(PDFPath);
|
||||
DateTime tEnd = DateTime.Now;
|
||||
MyStatus = pdfFile + " created.";
|
||||
MyStatus = string.Format("{0} created in {1:0.} milliseconds", pdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds));
|
||||
MyStatus = _PdfFile + " created.";
|
||||
MyStatus = string.Format("{0} created in {1:0.} milliseconds", _PdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds));
|
||||
if (OpenPDF)
|
||||
{
|
||||
System.Diagnostics.Process.Start(_PdfFile);
|
||||
this.Close();
|
||||
return;
|
||||
}
|
||||
btnOpenFolder.Visible = btnOpenPDF.Visible = true;
|
||||
}
|
||||
|
||||
private void btnOpenPDF_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(_PdfFile);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnOpenFolder_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("Explorer", "/select," + _PdfFile);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user