This method terminates the current print job.
Parameters
None
Return Value
Returns True if successful. Returns False if unsuccessful.
Explanation
The PrintAbortDoc method terminates the current print job and erases everything the application has written to the device since the last call of the PrintStartDoc method. The PrintAbortDoc method should be used with the PrintStartDoc, PrintStartPage, PrintEndPage, and the PrintEndDoc methods and is written between PrintStartPage and PrintEndPage. Note: when the ButtonName, Caption, and Message properties are set and the Cancel Printing dialog box is displayed, the ImageKit9 calls the PrintAbortDoc method internally so it is not necessary to use this method in such cases.
Example for terminating a print job
In C++Builder
bool Ret;
int i;
bool bAbort = false;
VImageKit1->PrintDraw->PrintFileName = "Default";
if (VImageKit1->PrintDraw->PrintCreateDC(vikPrintFileName) ==
false) return;
VImageKit1->PrintDraw->DocName = "ImageKit Print Sample";
if (VImageKit1->PrintDraw->PrintStartDoc() != false) {
for (i = 0; i < 100; i++) {
VImageKit1->PrintDraw->PrintStartPage();
//Draw text or image here
if (i == 50) {
VImageKit1->PrintDraw->PrintAbortDoc();
bAbort =
true;
}
VImageKit1->PrintDraw->PrintEndPage();
if (bAbort) break;
}
VImageKit1->PrintDraw->PrintEndDoc();
}
VImageKit1->PrintDraw->PrintDeleteDC();
In Delphi
Ret: Boolean;
i: Integer;
bAbort: Boolean;
VImageKit1.PrintDraw.PrintFileName := 'Default';
if VImageKit1.PrintDraw.PrintCreateDC(vikPrintFileName) = False
then Exit;
VImageKit1.PrintDraw.DocName := 'ImageKit Print Sample';
if (VImageKit1.PrintDraw.PrintStartDoc <> False) then
begin
bAbort := False;
for i := 0 to 99 do
begin
VImageKit1.PrintDraw.PrintStartPage;
//Draw text or image here
if i = 50 then
begin
VImageKit1.PrintDraw.PrintAbortDoc;
bAbort :=
True;
end;
VImageKit1.PrintDraw.PrintEndPage;
if bAbort then Break;
end;
VImageKit1.PrintDraw.PrintEndDoc;
end;
VImageKit1.PrintDraw.PrintDeleteDC;