StartDoc, EndDoc Commands

Purpose

Starts a new printer job on a printer device.

Syntax

[Printer.]StartDoc name [, o]

[Printer.]EndDoc

name:sexp
o:Variant variable

Description

StartDoc is a method of the Printer object. StartDoc must be invoked to start a printer job and is used before StartPage. name can be any text string used to identify the job. This name will be shown in the Printer Manager of the operation system during the output. A printer job is closed by invoking EndDoc.

When used without the Printer object the output must be redirected first to the printer using Output = .

An output device can be a printer, a fax, a copy machine, etc. any device, the operating system allow to use as a printer.

The optional Variant variable o is undocumented and is not mirrored in the GDI Printer API function of the same name.

Example

OpenW 1

Local h As Handle

Dlg Print Win_1, 40, h

If h <> 0

SetPrinterHDC h

// output to the standard device

Output = Printer : FontSize = 12

StartDoc "test" : StartPage

Print "GFA"

Circle 200, 200, 150

Box 350, 200, 450, 300

EndPage : StartPage

Print "GFA2"

EndPage : EndDoc

Output = Win_1 : Print "Printing finished"

Else

Print "Printing Cancelled"

EndIf

Remarks

StartDoc starts a print job. StartPage prepares the printer driver to accept data. EndPage informs the device that the application has finished writing to a page. The printer spooler realizes the output on the printer. Repeat StartPage/EndPage for the next page. EndDoc ends a print job.

When the printer is used a line printer with Lprint, the printer job is automatically created. Therefore, Lprint ""; is the same as StartDoc ""/StartPage.

See Also

Printer, StartDoc, EndPage, StartPage

{Created by Sjouke Hamstra; Last updated: 04/10/2014 by James Gaite}