_cef_pdf_print_settings_t

Struct _cef_pdf_print_settings_t 

Source
#[repr(C)]
pub struct _cef_pdf_print_settings_t {
Show 18 fields pub size: usize, pub landscape: c_int, pub print_background: c_int, pub scale: f64, pub paper_width: f64, pub paper_height: f64, pub prefer_css_page_size: c_int, pub margin_type: cef_pdf_print_margin_type_t, pub margin_top: f64, pub margin_right: f64, pub margin_bottom: f64, pub margin_left: f64, pub page_ranges: cef_string_t, pub display_header_footer: c_int, pub header_template: cef_string_t, pub footer_template: cef_string_t, pub generate_tagged_pdf: c_int, pub generate_document_outline: c_int,
}
Expand description

Structure representing PDF print settings. These values match the parameters supported by the DevTools Page.printToPDF function. See https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF

Fields§

§size: usize

Size of this structure.

§landscape: c_int

Set to true (1) for landscape mode or false (0) for portrait mode.

§print_background: c_int

Set to true (1) to print background graphics.

§scale: f64

The percentage to scale the PDF by before printing (e.g. .5 is 50%). If this value is less than or equal to zero the default value of 1.0 will be used.

§paper_width: f64

Output paper size in inches. If either of these values is less than or equal to zero then the default paper size (letter, 8.5 x 11 inches) will be used.

§paper_height: f64§prefer_css_page_size: c_int

Set to true (1) to prefer page size as defined by css. Defaults to false (0), in which case the content will be scaled to fit the paper size.

§margin_type: cef_pdf_print_margin_type_t

Margin type.

§margin_top: f64

Margins in inches. Only used if |margin_type| is set to PDF_PRINT_MARGIN_CUSTOM.

§margin_right: f64§margin_bottom: f64§margin_left: f64§page_ranges: cef_string_t

Paper ranges to print, one based, e.g., ‘1-5, 8, 11-13’. Pages are printed in the document order, not in the order specified, and no more than once. Defaults to empty string, which implies the entire document is printed. The page numbers are quietly capped to actual page count of the document, and ranges beyond the end of the document are ignored. If this results in no pages to print, an error is reported. It is an error to specify a range with start greater than end.

§display_header_footer: c_int

Set to true (1) to display the header and/or footer. Modify |header_template| and/or |footer_template| to customize the display.

§header_template: cef_string_t

HTML template for the print header. Only displayed if |display_header_footer| is true (1). Should be valid HTML markup with the following classes used to inject printing values into them:

  • date: formatted print date
  • title: document title
  • url: document location
  • pageNumber: current page number
  • totalPages: total pages in the document

For example, “” would generate a span containing the title.

§footer_template: cef_string_t

HTML template for the print footer. Only displayed if |display_header_footer| is true (1). Uses the same format as |header_template|.

§generate_tagged_pdf: c_int

Set to true (1) to generate tagged (accessible) PDF.

§generate_document_outline: c_int

Set to true (1) to generate a document outline.

Trait Implementations§

Source§

impl Clone for _cef_pdf_print_settings_t

Source§

fn clone(&self) -> _cef_pdf_print_settings_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for _cef_pdf_print_settings_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for _cef_pdf_print_settings_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.