Expand description
Print a document.
§Examples
Print a file
use std::{fs::File, os::fd::AsFd};
use ashpd::desktop::print::PrintProxy;
async fn run() -> ashpd::Result<()> {
let proxy = PrintProxy::new().await?;
let file =
File::open("/home/bilelmoussaoui/gitlog.pdf").expect("file to print was not found");
let pre_print = proxy
.prepare_print(
None,
"prepare print",
Default::default(),
Default::default(),
None,
true,
)
.await?
.response()?;
proxy
.print(None, "test", &file.as_fd(), Some(pre_print.token), true)
.await?;
Ok(())
}
Structs§
- Setup the printed pages.
- A response to a
PrintProxy::prepare_print
request. - The interface lets sandboxed applications print.
- Print settings to set in the print dialog.
Enums§
- The page orientation.
- The print quality.