PrintJob Method

Summary
Provides a callback function called from the Network Virtual Printer Driver at job start.
Syntax
C#
C++/CLI
public bool PrintJob( 
   PrintJobData printJobData 
) 
bool PrintJob(  
   PrintJobData^ printJobData 
)  

Parameters

printJobData
PrintJobData class containing the information about the print job.

Return Value

returning false from this function will cause the cancellation of the print job.

Remarks

This callback function will be called by the Network Virtual Printer Driver, with the printer information.

The user will read the information and act accordingly.

The user must fill the UserData field of the printJobData parameter. This data will be sent to the server machine and can be used to provide custom behaviors.

Data in the server side can be read using property.

Example
C#
using Leadtools.Printer.Client; 
 
 
 
// This is how the Client Demo DLL should be implemented. 
class LEADTOOLSNetworkClient : IVirtualPrinterClient 
{ 
   #region IVirtualPrinterClient Members 
 
   //Implement PrinterJob to be called when printer start printing job 
   bool IVirtualPrinterClient.PrintJob(PrintJobData printJobData) 
   { 
      string strMessage; 
      strMessage = "job printer from machine" + printJobData.ClientMachineName; 
      Console.WriteLine(strMessage); 
 
      //return true to continue job, false to cancel 
      return true; 
   } 
 
   //Implement PrinterJob to be called when printer ends printing job 
   void IVirtualPrinterClient.Shutdown(string virtualPrinterName) 
  
   { 
      string strMessage; 
      strMessage = "Printer " + virtualPrinterName + " Shut down"; 
      Console.WriteLine(strMessage); 
   } 
 
   //Implement PrinterJob to be called when printer job starts up 
   bool IVirtualPrinterClient.Startup(string virtualPrinterName, byte[] initialData) 
   { 
      string strMessage; 
      strMessage = "Printer " + virtualPrinterName + " Start Up"; 
      Console.WriteLine(strMessage); 
 
      //return true to continue job, false to cancel 
      return true; 
   } 
 
   #endregion 
} 
Requirements

Target Platforms

Help Version 22.0.2023.1.25
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.