LEADTOOLS Virtual Printer (Leadtools.Printer.Client assembly)
LEAD Technologies, Inc

Startup Method

Example 





A System.String that represents the printer name.
Initialization data set by the server machine.
Provides a callback function called from the Network Virtual Printer Driver when a print job starts up.
Syntax
bool Startup( 
   string virtualPrinterName,
   byte[] initialData
)
'Declaration
 
Function Startup( _
   ByVal virtualPrinterName As String, _
   ByVal initialData() As Byte _
) As Boolean
'Usage
 
Dim instance As IVirtualPrinterClient
Dim virtualPrinterName As String
Dim initialData() As Byte
Dim value As Boolean
 
value = instance.Startup(virtualPrinterName, initialData)
bool Startup( 
   string virtualPrinterName,
   byte[] initialData
)
function Leadtools.Printer.Client.IVirtualPrinterClient.Startup( 
   virtualPrinterName ,
   initialData 
)

Parameters

virtualPrinterName
A System.String that represents the printer name.
initialData
Initialization data set by the server machine.

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 name and the initialization data set by Leadtools.Printer.Printer.SetNetworkInitialData(System.Byte[]).

Example
 
' this is how the Client Demo DLL should be implemented.
     Private Class LEADTOOLSNetworkClient : Implements IVirtualPrinterClient

#Region "IVirtualPrinterClient Members"

         'Implement PrinterJob to be called when printer start printing job
         Private Function PrintJob(ByVal printJobData As PrintJobData) As Boolean Implements IVirtualPrinterClient.PrintJob
            Dim strMessage As String
            strMessage = "job printer from machine" & printJobData.ClientMachineName
            MessageBox.Show(strMessage)

            'return true to continue job, false to cancel
            Return True
         End Function

         'Implement PrinterJob to be called when printer ends printing job
         Private Sub Shutdown(ByVal virtualPrinterName As String) Implements IVirtualPrinterClient.Shutdown
            Dim strMessage As String
            strMessage = "Printer " & virtualPrinterName & " Shut down"
            MessageBox.Show(strMessage)
         End Sub

         'Implement PrinterJob to be called when printer job starts up
         Private Function Startup(ByVal virtualPrinterName As String, ByVal initialData As Byte()) As Boolean Implements IVirtualPrinterClient.Startup
            Dim strMessage As String
            strMessage = "Printer " & virtualPrinterName & " Start Up"
            MessageBox.Show(strMessage)

            'return true to continue job, false to cancel
            Return True
         End Function

#End Region
      End Class
// 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;
      MessageBox.Show(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";
      MessageBox.Show(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";
      MessageBox.Show(strMessage);

      //return true to continue job, false to cancel
      return true;
   }

   #endregion
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IVirtualPrinterClient Interface
IVirtualPrinterClient Members
Leadtools.Printer.Printer.SetNetworkInitialData(System.Byte[])

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.