pub struct PrintDoc { /* private fields */ }Expand description
a print job of several pages (see the file header; E9)
Implementations§
Source§impl PrintDoc
impl PrintDoc
Sourcepub fn begin(job: &PrintJob<'_>, pages: u32) -> Result<PrintDoc, i32>
pub fn begin(job: &PrintJob<'_>, pages: u32) -> Result<PrintDoc, i32>
start a job: the system’s print dialog where the platform has one (printer, paper, orientation, copies; with pages > 0 a page range of 1..=pages), never one in the test variant (jfgui_PRINT_TO). job: the title (spooler, PDF /Title; “” = “Dokument”), paper, PJF_LANDSCAPE / PJF_CENTER / PJF_SMASK, margin, scale, percent, dpi – its src is not used. Err: ERR_CANCEL (the dialog was cancelled), ERR_UNSUPPORTED (no printing here, no window, the manifest forbids it), ERR_IO
Sourcepub fn page(&self) -> PPage
pub fn page(&self) -> PPage
the page the job prints on (pt; the printer’s unprintable edges; the orientation the dialog chose in flags): lay the pages out for it
Sourcepub fn copies(&self) -> u32
pub fn copies(&self) -> u32
the copies the dialog chose (informative: the printer makes them; 1 in the test variant)
Sourcepub fn wants(&self, n: u32) -> bool
pub fn wants(&self, n: u32) -> bool
page n (from 1) is in the range the dialog chose (always without a range)
Sourcepub fn pdf_native(&self) -> bool
pub fn pdf_native(&self) -> bool
the platform prints a PDF document as it is (add_pdf): Linux’s portal and the test variant there; Windows and the others: images only
Sourcepub fn add_image(&mut self, src: &PrintSrc<'_>) -> i32
pub fn add_image(&mut self, src: &PrintSrc<'_>) -> i32
one page: the image laid out on the page as layout() places it (the job’s scale, dpi, margin, PJF_CENTER; clipped to the printable area) -> 0 / ERR_DIMS / ERR_UNSUPPORTED (a format or after add_pdf) / ERR_IO / ERR_NOMEM
Sourcepub fn add_pdf(&mut self, pdf: &[u8]) -> i32
pub fn add_pdf(&mut self, pdf: &[u8]) -> i32
the whole job as a PDF of the app’s own, printed as it is (only where pdf_native(), before any add_image) -> 0 / ERR_UNSUPPORTED