AbortDoc Command

Purpose

Cancels a printer job.

Syntax

[Printer.]AbortDoc

Description

AbortDoc stops the current print job and erases everything drawn since the last call to the StartDoc function.

Applications should call the AbortDoc function to stop a print job if an error occurs, or to stop a print job after the user cancels that job. To end a successful print job, an application should call the EndDoc function.

Example

OpenW 1

Local x%, o

Output = Printer

StartDoc "GFA32 Test"

StartPage

Print "GFA"

Circle 200, 200, 150

Box 350, 200, 450, 300

EndPage

StartPage

Print "GFA2"

EndPage

AbortDoc

EndDoc

Output = Win_1 : Print "finished"

KeyGet x% : CloseW 1 : End

Remarks

A printer job is most often finished before it is even started and is mostly canceled through the printer tray icon. Maybe AbortDoc has some use, though.

Another way of aborting a printer job from a program is by using the Printer object event sub Printer_AbortProc.

See Also

Printer StartDoc, EndDoc, NewFrame, StartPage

{Created by Sjouke Hamstra; Last updated: 23/09/2014 by James Gaite}