JFLib

plat/linux_print.rs (Linux)#

Source: lib/plat/linux_print.rs

linux_print -- printing on Linux: xdg-desktop-portal Print with a PDF of the job
                                                   [src/plat/linux/lx_print.s; docs/modules/PRINT.md]

  print(job) -> 0 printed / ERR_CANCEL / ERR_UNSUPPORTED / ERR_IO / ERR_NOMEM / ERR_DIMS.
       PreparePrint (the portal's dialog: printer, paper, copies; our paper and orientation
       suggested), then the job laid out on the chosen page as a one-page PDF (print_pdf)
       in a memfd handed to Print.
  Test / headless variants (never a dialog):
       jfgui_PRINT_TO=FILE.pdf    the PDF is written to FILE (paper from job.paper)
       jfgui_PRINT_SMASK=1        (with jfgui_PRINT_TO) alpha as /SMask instead of white
       jfgui_PRINT_PORTAL=1       allow the portal without a window (fake bus tests);
       otherwise a run without a display (headless) returns ERR_UNSUPPORTED.
  doc_begin / doc_image / doc_end / doc_abort   (print.rs PrintDoc, E9) PreparePrint once
       (its connection stays open), the pages into one PDF of several pages (or the app's own
       PDF: pdf_native), at the end the PDF in a memfd to Print; the test variants above
       (jfgui_PRINT_TO writes the PDF of the pages into FILE).
  • fn print(job: &mut PrintJob) -> i32 print one image on one page (see the file header) [plat_print]

Source: docs/API.md in the JFLib repository.