function pj = finish( pj )
%Finish Method to end a PrintJob at its current page.
%   Finish current page and close connection to device or file output is 
%   beeing spooled to. Proper way to end a print job.
%   
%   See also CANCEL

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

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

pj.Active = 0;

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