Support,
use following code to print PDF:
PdfViewer viewer = new PdfViewer();
PrintDocument prtdoc = new PrintDocument();
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense("Aspose.Pdf.lic");
license.Embedded = true;
viewer.PrintPageDialog = false;
viewer.AutoResize = false;
viewer.AutoRotate = false;
viewer.FormPresentationMode = Aspose.Pdf.Devices.FormPresentationMode.Production;
viewer.PrintAsImage = false;
viewer.Resolution = 600;
if (job.DocumentType == PrinterDocumentType.PDF)
{
viewer.BindPdf(job.DocumentDataStream);
}
if (job.DocumentType == PrinterDocumentType.TIFF)
{
TiffHelper helper = new TiffHelper();
Stream stream = helper.ConvertTIFFToPDF(job);
viewer.BindPdf(stream);
}
//pgs.PaperSource = ps.PaperSources[3]; Tray three.
System.Drawing.Printing.PrinterSettings ps = viewer.GetDefaultPrinterSettings();
PageSettings pgs = viewer.GetDefaultPageSettings();
ps.PrinterName = job.Printer.UNCPath;
//pgs.PaperSource = ps.PaperSources[3]; Tray three.
viewer.EndPrint += ViewerOnEndPrint;
viewer.PrintDocumentWithSettings(pgs, ps);
viewer.Close();
I thought end print event would tell if it was successful or not. But it has no such information.
How to tell if printing was successful or not?