TPrintPreview event to cancel printing...

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

TPrintPreview event to cancel printing...

Postby mrtossas » 19/10/18 16:41

Hi,

In TPrintPreview 5.30, this is my code:

Begindoc;
for i := 1 to 1000 do begin
Print YYY ZZZ...
if XXX then NewPage;

if finish_now then begin
EndDoc;
PrintPreview.Abort;
ShowMessage('Canceled Print');
end;

end; // for
EndDoc;

BUT in TPrintPreview 5.30 not exit the Abort method...

How would I have to rewrite my code in order to cancel the printing when I needed it?

Thanks!
mrtossas
Member
Member
 
Posts: 1
Joined: 19/10/18 16:26

Re: TPrintPreview event to cancel printing...

Postby Kambiz » 17/11/18 12:49

Hi,

If you are creating pages, your code should handle cancellation.
If you are printing or exporting pages, you can use OnPageProcessing event to cancel the operation.
To cancel a print job, call the Abort method of the global Printer object.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2424
Joined: 07/03/03 19:10


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 1 guest