pub struct ViewerPreferences { /* private fields */ }Expand description
The preferences a document can ask for.
Every field is optional, and an unset one leaves the key alone rather than writing a default — which is what lets this change one preference of a document without flattening the rest.
use pdfrum_edit::{Duplex, ViewerPreferences};
let prefs = ViewerPreferences::new()
.hide_toolbar(true)
.duplex(Duplex::DuplexFlipLongEdge)
.num_copies(2);
assert_eq!(prefs, prefs.clone());Implementations§
Source§impl ViewerPreferences
impl ViewerPreferences
Sourcepub fn hide_toolbar(self, yes: bool) -> Self
pub fn hide_toolbar(self, yes: bool) -> Self
/HideToolbar: hide the reader’s toolbar while the document is open.
/HideMenubar: hide the reader’s menu bar.
Sourcepub fn hide_window_ui(self, yes: bool) -> Self
pub fn hide_window_ui(self, yes: bool) -> Self
/HideWindowUI: hide the reader’s own scroll bars and panes, leaving
the page.
Sourcepub fn fit_window(self, yes: bool) -> Self
pub fn fit_window(self, yes: bool) -> Self
/FitWindow: resize the window to the first page.
Sourcepub fn center_window(self, yes: bool) -> Self
pub fn center_window(self, yes: bool) -> Self
/CenterWindow: centre the window on the screen.
Sourcepub fn display_doc_title(self, yes: bool) -> Self
pub fn display_doc_title(self, yes: bool) -> Self
/DisplayDocTitle: title the window with /Info /Title rather than
the file name.
PDF/UA requires this, since a file name is not an accessible name.
Sourcepub fn direction_r2l(self, yes: bool) -> Self
pub fn direction_r2l(self, yes: bool) -> Self
/Direction: R2L when true, L2R when false.
This orders the pages in a spread, not the text in a line — a right-to-left script in a left-to-right document is the ordinary case and wants this left alone.
Sourcepub fn print_scaling(self, yes: bool) -> Self
pub fn print_scaling(self, yes: bool) -> Self
/PrintScaling: AppDefault when true, None when false.
false is what a document asks for when its page size is the point —
a form, a label sheet — and scaling to the paper would falsify it.
Sourcepub fn num_copies(self, copies: i64) -> Self
pub fn num_copies(self, copies: i64) -> Self
/NumCopies: the number of copies the print dialog offers by default.
Trait Implementations§
Source§impl Clone for ViewerPreferences
impl Clone for ViewerPreferences
Source§fn clone(&self) -> ViewerPreferences
fn clone(&self) -> ViewerPreferences
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more