com.sap.ip.me.api.pios.printer
Class PrinterParameters

java.lang.Object
  extended bycom.sap.ip.me.api.pios.connection.ConnectionParameters
      extended bycom.sap.ip.me.api.pios.printer.PrinterParameters

public final class PrinterParameters
extends ConnectionParameters

Use a PrinterParameters class instance as a parameter to the open method of the Connector to create a printer connection. A connection object is returned. This object depends on the printer mode parameter. Each printer mode has a specific connection object. Use constant attributes names, found on PrinterConnection.Attributes, to determine if a particular printer functionality is supported.

Example: Open a connection in line mode.
 
 
	Connector connector = Connector.getInstance();

	DriverInfo[] printers = connector.listDrivers(ConnectionType.PRINTER);
	PrinterParameters parameters = new PrinterParameters(printers[0]);
	parameters.setPrinterMode(PrinterParameters.LINE_MODE);

	LinePrinter lp = (LinePrinter)connector.open(parameters);

	//Add some code here
 
	lp.doPrint(1);
	lp.close();

 
 

Since:
MI 2.5
Author:
Abaco
See Also:
PrinterConnection, GraphicPrinter, LinePrinter

Field Summary
static int GRAPHIC_MODE
          Constant to indicate a graphic mode printer.
static int LINE_MODE
          Constant to indicate a line mode printer.
 
Constructor Summary
PrinterParameters(DriverInfo info)
          Creates a new PrinterParameters object.
 
Method Summary
 int getPrinterMode()
          Returns the printer mode.
 void setPrinterMode(int mode)
          Sets the printer mode.
 
Methods inherited from class com.sap.ip.me.api.pios.connection.ConnectionParameters
getConnection, getDriver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_MODE

public static final int LINE_MODE
Constant to indicate a line mode printer.

See Also:
Constant Field Values

GRAPHIC_MODE

public static final int GRAPHIC_MODE
Constant to indicate a graphic mode printer.

See Also:
Constant Field Values
Constructor Detail

PrinterParameters

public PrinterParameters(DriverInfo info)
Creates a new PrinterParameters object.

Parameters:
info - The driver information object
Method Detail

setPrinterMode

public void setPrinterMode(int mode)
Sets the printer mode. Use line mode when printing one line at a time and graphic mode when x, y coordinates positioning is needed.

Parameters:
mode - the printer mode

getPrinterMode

public int getPrinterMode()
Returns the printer mode.

Returns:
The printer mode.


Copyright © 2005 SAP AG. All Rights Reserved.