CAPS Universe documentation  1.0.4
All you need to know to be successful
Callback page_print()

Called when the framework has rasterized the current page and this data is ready to be printed. It is called once per page. E.g. once per medium in simplex print and twice per medium when printing in duplex.

  • parameter you get
    • framework handle
    • your private data hint
  • you can expect as already done
    • everything is working as expected, e.g. communication with the printing coordinator and the printer device
  • what you can do
    • everything else depends on your requirements
  • what you must do
    • process the raster data and transform it into the printer's wire data format
  • values you should return
    • 0 everything is okay, the framework can continue
    • -EINVAL if the page cannot be processed/printed and the job should be terminated.
    • -ENODEV if something is really bad with your printer and the framework should terminate.
    • -ENXIO if a transaction with the printer's stream failed and the framework should terminate.
Note
For the case of -EINVAL and -ENXIO, you should use caps_drv_job_canceled() or caps_drv_job_aborted() to set a useful error message why the job was terminated (if you have one. Else the framework will set a generic one, which is most of the time less helpful).

Functions related to this state: