PrintDevData Event - Java

<< Click to Display Table of Contents >>

Navigation:  Events Generated by the Java Control >

PrintDevData Event - Java

Previous pageReturn to chapter overviewNext page

[GUI version only]

Is sent only while printing, exactly before printing a new page and immediately after BeforePrintNewPage() has been sent. The only use for this event is to call DevSendData() in response.

DevSendData() enables your application to send escape sequences to the printing device. So it is possible to select for example an output paper bin by code (or whatever other functionality is provided by the connected printer).

public void PrintDevData(

PrintEvent e

)

PrintEvent e

The print event is defined as:

public class PrintEvent extends java.util.EventObject {

private int page;

private int printResultingAction=PrintResultingAction.Ok;

 

public void setPrintResultingAction(int printResultingAction) {

  this.printResultingAction = printResultingAction;

 }

 

public int getPrintResultingAction() {

  return printResultingAction;

 }

 

public int getPage() {

  return page;

 }

 

public PrintEvent(VpeControl source, int page) {

  super(source);

  this.page = page;

 }

}

 

int page

current page number that will be printed

 

printResultingAction is a return-parameter, i.e. you can assign it one of the following values to control the resulting action of VPE:

public class PrintResultingAction

{

public static final Ok = 0;

public static final Change = 1;

}

Remarks:

When your application handles this event, the PrintAction member contains the current status of the printing progress. Your applications’s event handler can return a value in the PrintResultingAction member.

 

Your application should return Ok if it processes this message without calling DevSendData().

 

If it called DevSendData(), your application must return Change.

 

See also:

BeforePrintNewPage Event