BCL easyPDF SDK
easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

PrinterResultMessage Property

Gets printer driver printing result in string format. Please see PrinterResult for more information.

Type:

String (read-only)

Remarks

If error is not raised during PDF conversion, you do not need to check this property.

Example Usage

On Error goto Function_Err

Set oPrinter = CreateObject("easyPDF.Printer.8")
Set oPrintJob = oPrinter.PrintJob
oPrintJob.PrintOut "C:\test\input.doc", "C:\test\output.pdf"

Function_End:
    Exit Function

Function_Err:
    ' Get error message
    MsgBox Err.Description

    ' Look at the error number
    If Err.Number = PRN_R_CONVERSION_FAILED Then
        ' More detailed error message
        MsgBox "Conversion Result: " + oPrintJob.ConversionResultMessage

        ' See if we have error message from printer driver
        nResult = oPrintJob.ConversionResult
        If nResult = PRN_CR_CONVERSION Or _
           nResult = PRN_CR_CONVERSION_INIT Or _
           nResult = PRN_CR_CONVERSION_PRINT Then
            ' Error message from printer driver
            MsgBox "Printer Result: " + oPrintJob.PrinterResultMessage

            ' You can also get the result in integer form
            nPrinterResult = oPrintJob.PrinterResult
        End If
    End If

    Resume Function_End

Example Usage (C#)

Printer printer = new Printer();
try
{
   printer.PrintJob.PrintOut(@"c:\test\input.docx", @"c:\test\output.pdf");
}
catch(System.Runtime.InteropServices.COMException err)
{
   // Get the error message
   MessageBox.Show(string.Format("Error: {0} ({1})", err.Message, err.ErrorCode));
   if(err.ErrorCode == (int)prnResult.PRN_R_CONVERSION_FAILED)
   {
      // More detailed error message
      MessageBox.Show(string.Format("Conversion Result: {0} ({1})", printer.PrintJob.ConversionResultMessage, printer.PrintJob.ConversionResult));

      // See if we have error message from printer driver
      switch(printer.PrintJob.ConversionResult)
      {
         case prnConversionResult.PRN_CR_CONVERSION:
         case prnConversionResult.PRN_CR_CONVERSION_INIT:
         case prnConversionResult.PRN_CR_CONVERSION_PRINT:
            // Error message from printer driver
            MessageBox.Show(string.Format("Printer Result: {0} ({1})", printer.PrintJob.PrinterResultMessage, printer.PrintJob.PrinterResult));
            break;
      }
   }
}