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§impl Debug for ViewerPreferences
impl Debug for ViewerPreferences
Source§impl Default for ViewerPreferences
impl Default for ViewerPreferences
impl Eq for ViewerPreferences
Source§impl PartialEq for ViewerPreferences
impl PartialEq for ViewerPreferences
impl StructuralPartialEq for ViewerPreferences
Auto Trait Implementations§
impl Freeze for ViewerPreferences
impl RefUnwindSafe for ViewerPreferences
impl Send for ViewerPreferences
impl Sync for ViewerPreferences
impl Unpin for ViewerPreferences
impl UnsafeUnpin for ViewerPreferences
impl UnwindSafe for ViewerPreferences
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.