This method terminates the current print job.

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.PrintAbortDoc
[Visual C++]     [ BOOL = ]imagekitcontrolname.GetPrintDraw().PrintAbortDoc()

Parameters

None

Return Value

Returns True (nonzero) if successful. Returns False (0) 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 ImageKit8 calls the PrintAbortDoc method internally so it is not necessary to use this method in such cases.


Example for terminating a print job

Visual Basic

    Dim Ret As Boolean, bAbort As Boolean

    Dim i As Integer


    ImageKit1.PrintDraw.PrintFileName = "Default"

    If ImageKit1.PrintDraw.PrintCreateDC(ikPrintFileName) = False Then Exit Sub


    ImageKit1.PrintDraw.DocName = "ImageKit Print Sample"

    If (ImageKit1.PrintDraw.PrintStartDoc <> False) Then

       bAbort = False

       For i = 0 To 99

          ImageKit1.PrintDraw.PrintStartPage


          //code to draw image or text


          If i = 50 then

             ImageKit1.PrintDraw.PrintAbortDoc

             bAbort = True

          End If

          ImageKit1.PrintDraw.PrintEndPage

          If bAbort = True Then Exit For;

      Next i

      ImageKit1.PrintDraw.PrintEndDoc

    End If

    ImageKit1.PrintDraw.PrintDeleteDC


Visual C++

    BOOL Ret, bAbort;

    int i;


    ImageKit1.GetPrintDraw().SetPrintFileName("Default");

    if (ImageKit1.GetPrintDraw().PrintCreateDC(1) == FALSE) return;


    ImageKit1.GetPrintDraw().SetDocName("ImageKit Print Sample");

    if (ImageKit1.GetPrintDraw().PrintStartDoc() != FALSE) {

       for (i = 0; i < 100; i++) {

          ImageKit1.GetPrintDraw().PrintStartPage();


          //code to draw image or text


          if (i == 50) {

             ImageKit1.GetPrintDraw().PrintAbortDoc();

             bAbort = true;

          }

          ImageKit1.GetPrintDraw().PrintEndPage();

          if (bAbort) break;

      }

      ImageKit1.GetPrintDraw().PrintEndDoc();

    }

    ImageKit1.GetPrintDraw().PrintDeleteDC();

 

The ImageKit8 ActiveX is a product created by Newtone Corporation