PpStartJob()

Start a print job

Synopsis:

int PpStartJob( PpPrintContext_t *pc );

Arguments:

pc
The pointer to a PpPrintContext_t structure that was returned by PpCreatePC().

Library:

ph

Description:

This function initializes the current print job. This includes opening the destination device or file and writing out the print-start command and any modified portions of the print context.

The pc argument is a pointer to the print context for the print job. This must have been created by PpCreatePC(), and may have been configured by calls to PpSetPC(), or by the PtPrintSel widget.

You normally call this function after setting up the print context with PpSetPC() and/or the PtPrintSelection() convenience function.

If the Pp_PC_DEVICE or Pp_PC_FILENAME member of the print context isn't specified, the printer in Pp_PC_NAME is used to determine the print destination. If Pp_PC_NAME isn't specified either, the default printer definition is used. If a print destination still isn't set in the print context, PpStartJob() fails and errno is set to ESRCH.


Note: Photon draw operations won't be routed through the print context until you call PpContinueJob().

Returns:

0
Success.
-1
The print context couldn't be made active, probably because the required working files couldn't be created. See errno for the specific error.

Errors:

ESRCH
No output target is specified in the print context and no printer definition could be found

Examples:

See PpContinueJob().

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PpContinueJob(), PpCreatePC(), PpEndJob(), PpGetPC(), PpPrintContext_t, PpPrintNewPage(), PpPrintWidget(), PpReleasePC(), PpSetPC(), PpSuspendJob()

Printing in the Photon Programmer's Guide