function pj = cancel( pj )
%Cancel Method to interupt a print job and finish it right now.
%   Stop the spooling of output. System dependent on how soon the current
%   print job can be stopped. Output will be terminated or incomplete depending
%   on driver and operating system.
%
%   See also FINISH

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.1 $  $Date: 1998/04/17 15:57:08 $

if nargin ~= 1 | ~isa(pj,'printjob')
    error('Requires PrintJob object')
end

pj.Active = 0;

%Tell internal driver
if feature('NewPrintAPI')
    err = hardcopy( pj, 'cancel' )
end
