[Previous] [Contents] [Index] [Next]

PpPrintOpen()

Initialize the current print job

Synopsis:

int PpPrintOpen( PpPrintContext_t *pc );

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 PpPrintCreatePC(), and may have been configured by calls to PpPrintSetPC(), or by the PtPrintSel widget.

You normally call this function after setting up the print context with PpPrintSetPC() 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, PpPrintOpen() fails and errno is set to ESRCH.


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

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 PpPrintStart().

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PpPrintClose(), PpPrintCreatePC(), PpPrintGetPC(), PpPrintNewPage(), PpPrintReleasePC(), PpPrintSetPC(), PpPrintStart(), PpPrintStop(), PpPrintWidget()


[Previous] [Contents] [Index] [Next]