Continue a suspended print job
PhDrawContext_t *PpContinueJob( PpPrintContext_t *pc );
ph
This function makes the provided print context pc active (i.e. from this point until the print context is deactivated, everything drawn is part of the printed output). The print context is initialized if this hasn't already been done by a call to PpStartJob().
All subsequent Photon draw commands are routed through this print context until:
Or:
A pointer to the previously active draw context, or NULL if the print context couldn't be made active—see errno for the specific error.
To print the contents of a scroll area:
int print_it( PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo ) { PhDim_t dim; ... pc = PpCreatePC(); // Set the default printer for this app only. // This overrides the default printer set via // the "prsetup" utility PpSetPC( pc, Pp_PC_NAME, "R&D", 0 ); // Pop up the standard print dialog and respond accordingly. switch( PtPrintSelection( ABW_base, &pos, "Select Printer", pc, 0 ) ) { // The user has selected print or preview -- PpEndJob() // handles the difference. case Pt_PRINTSEL_PRINT: case Pt_PRINTSEL_PREVIEW: PtFlush(); // Ensure no draws are pending. // Set the source size to be the size of the scroll // area's canvas. The contents of the canvas will // be scaled to fit the page. PtWidgetDim( PtValidParent( ABW_my_scrollarea ), &dim ); PpSetPC( pc, Pp_PC_SOURCE_SIZE, &dim, 0 ); PpStartJob( pc ); if( PpContinueJob( pc ) ) { // Force the canvas of the ScrollArea widget // to draw. PtDamageWidget( PtValidParent( ABW_my_scrollarea ) ); PtFlush(); } // Deactivate the pc and produce the printed output. PpEndJob( pc ); case Pt_PRINTSEL_CANCEL: break; } // Release the pc and its resources. PpReleasePC( pc ); return Pt_CONTINUE; }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PpCreatePC(), PpEndJob(), PpGetPC(), PpPrintContext_t, PpPrintNewPage(), PpReleasePC(), PpPrintWidget(), PpSetPC(), PpStartJob(), PpSuspendJob()
Printing in the Photon Programmer's Guide