RequestPrint Event - Java

<< Click to Display Table of Contents >>

Navigation:  Events Generated by the Java Control >

RequestPrint Event - Java

Previous pageReturn to chapter overviewNext page

[GUI version only]

Is fired to inform the application about the several stages during the printing process.

public void RequestPrint(

RequestPrintEvent e

)

RequestPrintEvent e

The request print event is defined as:

public class RequestPrintEvent extends java.util.EventObject {

private int printAction;

private int printResultingAction = PrintResultingAction.Ok;

 

public void setPrintResultingAction(int printResultingAction) {

  this.printResultingAction = printResultingAction;

 }

 

public int getPrintResultingAction() {

  return printResultingAction;

 }

 

public int getPrintAction() {

  return printAction;

 }

 

public RequestPrintEvent(VpeControl source, int printAction) {

  super(source);

  this.printAction = printAction;

 }

}

 

printAction has one of the following values:

public class PrintAction

{

public static final Abort = 0;

// User aborted while printing

public static final Start = 1;

// Print started

public static final End = 2;

// Print ended

public static final SetupAbort = 3;

// User aborted Setup-Dialog

public static final SetupStart = 4;

// Setup-Dialog started

public static final SetupEnd = 5;

// Setup-Dialog ended

}

 

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 Abort = 1;

}

Remarks:

Do not call CloseDoc() while processing this event. You would terminate a module that is working.

 

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, except for PrintAction = SetupStart, where your application may return in addition Abort to abort the print job. SetupStart is sent, when the user clicked the print button in the preview (or pushed the corresponding key). You have the option to abort the job, for you can then create and print internally a new document which is completely different to the preview.

 

Another use for the SetupStart message is, to pre-initialize the Device Control Properties at this stage, before the printer setup dialog will be shown to the user.