Please enable JavaScript to view this site.

TIFF Image Printer

Description

Returns a new instance of an IPNPrintSession object. A new print session object represents one printer from the pool of printers. A separate print session is needed for each file printed. The IPNPrintSession object copies the current settings from the IPNSession object and is used to monitor the status of the file as it is printed.

Syntax

expression.NewPrintSession(Timeout,FirstJobTimeout,AvailableTimeout,OptionsFlags)

where expression is a IPNSession object.

Returns a new IPNPrintSession instance , or NULL if a new printer session could not be retrieved.

Parameters

Integer Timeoout

How long to wait, in milliseconds, for a printer in the printer pool to become available.

Integer FirstJobTimeout

How long to wait, in milliseconds, for a job to appear in the printer queue before putting the printer back into the printer pool. This timeout only comes into effect after the printSession object has been released by the calling application.

Integer AvailableTimeout

How long to wait, in milliseconds, for a second job to appear in the printer queue. As long as new print jobs are submitted to the printer, the printer is not available. When AvailableTimeout milliseconds have passed with no additional jobs in the printer queue, the printer is made available and returned to the printer pool.

Integer OptionsFlags

Reserverd for future use; specify 0 for this parameter.

Remarks

After the document has been printed the print session object needs to be garbage collected in order to be released back into the printer pool. In .NET, use the method InteropServices.Marshal.FinalReleaseComObject to trigger the garbage collection.

If the print session is released but the file fails to print to the printer, the IPNPrintSession object will wait the timeout specified in the FirstJobTimeout parameter before being released back into the printer pool.

To determine if the file has been sent to the printer call the WaitForDocSpooling method on the print session object before calling FinalReleaseComObject to release the print session.

Supported Printers: TIFF Image Printer, PDF Image Printer, Raster Image Printer

See Also: SetSessionPrinter, SetPrinterProfile