//private bool bolPrintSuccess = false; ///// <summary> ///// 打印是否成功 ///// </summary> //[System.ComponentModel.Browsable( false )] //public bool PrintSuccess //{ // get // { // return bolPrintSuccess; // } //} protected override void OnEndPrint(PrintEventArgs e) { base.OnEndPrint(e); if (this.PreparePrintJob) { this.myPrintJob = null; PrinterInformation info = new PrinterInformation(this.PrinterSettings.PrinterName); foreach (PrintJob job in info.Jobs) { if (job.Document == this.DocumentName) { this.myPrintJob = job; break; } } } }
/// <summary> /// /// </summary> /// <returns>操作是否成功</returns> public bool LastPageEjected() { return(PrinterInformation.ControlJob(this, PrintJobControlCommand.LAST_PAGE_EJECTED, false)); }
/// <summary> /// 删除任务 /// </summary> /// <returns>操作是否成功</returns> public bool Delete() { return(PrinterInformation.ControlJob(this, PrintJobControlCommand.DELETE, false)); }
/// <summary> /// 发送到镜像打印端口 /// </summary> /// <returns>操作是否成功</returns> public bool SendToPrinter() { return(PrinterInformation.ControlJob(this, PrintJobControlCommand.SENT_TO_PRINTER, false)); }
/// <summary> /// 恢复打印任务 /// </summary> /// <returns>操作是否成功</returns> public bool Resume() { return(PrinterInformation.ControlJob(this, PrintJobControlCommand.RESUME, false)); }
/// <summary> /// 重新启动打印任务 /// </summary> /// <returns>操作是否成功</returns> public bool Restart() { return(PrinterInformation.ControlJob(this, PrintJobControlCommand.RESTART, false)); }
/// <summary> /// 暂停任务 /// </summary> /// <returns>操作是否成功</returns> public bool Pause() { return(PrinterInformation.ControlJob(this, PrintJobControlCommand.PAUSE, false)); }
/// <summary> /// 取消任务 /// </summary> /// <returns>操作是否成功</returns> public bool Cancel() { return(PrinterInformation.ControlJob(this, PrintJobControlCommand.CANCEL, false)); }
/// <summary> /// 刷新状态 /// </summary> public void Refresh() { PrinterInformation.RefreshPrintJob(this, true); }