Imports System.Windows.Forms Imports Leadtools.Printer.Client.Interfaces[C#]
using System.Windows.Forms using Leadtools.Printer.Client.Installer;
Public Class MyVirtualPrinterClient Implements IVirtualPrinterClient[C#]
public class MyVirtualPrinterClient : IVirtualPrinterClient
bool IVirtualPrinterClient.Startup(string virtualPrinterName, byte[] initialData) - This function will get called by the Virtual Printer Driver at startup
virtualPrinterName: printer namePrivate Function Startup(ByVal virtualPrinterName As String, ByVal initialData As Byte()) As Boolean Implements IVirtualPrinterClient.Startup MessageBox.Show("Job received from " & virtualPrinterName & "printer") Return True End Function[C#]
bool IVirtualPrinterClient.Startup(string virtualPrinterName, byte[] initialData) { MessageBox.Show("Job received from " + virtualPrinterName + "printer"); return true; }bool IVirtualPrinterClient.PrintJob(PrintJobData printJobData) - This function will be called as the print job is received by the driver
Private Function PrintJob(ByVal printJobData As PrintJobData) As Boolean Implements IVirtualPrinterClient.PrintJob MessageBox.Show("Job data Ip Address = " & printJobData. IpAddress & " Job ID = " & printJobData.JobID) 'the UserData will be sent to the server machine 'this data can be any user specified data format printJobData.UserData = New Byte() { CByte("H"c), CByte("E"c), CByte("L"c), CByte("L"c), CByte("O"c) } Return True End Function[C#]
bool IVirtualPrinterClient.PrintJob(PrintJobData printJobData) { MessageBox.Show("Job data Ip Address = " + printJobData. IpAddress + " Job ID = " + printJobData.JobID); //the UserData will be sent to the server machine //this data can be any user specified data format printJobData.UserData = new byte[] { (byte)'H', (byte)'E', (byte)'L', (byte)'L', (byte)'O' }; return true; }void IVirtualPrinterClient.Shutdown(string virtualPrinterName) - This function will be called as a shutdown event
Private Sub Shutdown(ByVal virtualPrinterName As String) Implements IVirtualPrinterClient.Shutdown MessageBox.Show("Shutdown received for " & virtualPrinterName & " printer") End Sub[C#]
void IVirtualPrinterClient.Shutdown(string virtualPrinterName) { MessageBox.Show("Shutdown received for " + virtualPrinterName + " printer"); }