Skip to main content

WebCaptureParams

Struct WebCaptureParams 

Source
pub struct WebCaptureParams {
Show 17 fields pub source: Option<WebCaptureSource>, pub url: Option<String>, pub output: Option<WebCaptureOutput>, pub page_size: Option<WebCapturePageSize>, pub orientation: Option<WebCaptureOrientation>, pub margin: Option<WebCaptureMargin>, pub full_page: Option<bool>, pub screen_size: Option<WebCaptureScreenSize>, pub viewport_width: Option<f64>, pub viewport_height: Option<f64>, pub delay_ms: Option<f64>, pub quality: Option<f64>, pub transparent_background: Option<bool>, pub block_ads: Option<bool>, pub remove_overlays: Option<bool>, pub output_name: Option<String>, pub extra: Object,
}
Expand description

Parameters of Web page to PDF or image (web-capture).

Fields§

§source: Option<WebCaptureSource>

html renders the uploaded HTML with scripts off; url captures a public web address. Default: "html".

§url: Option<String>

Public address to capture. When empty, the input file’s text is the address. Used when source is url.

§output: Option<WebCaptureOutput>

What to make: a PDF, or a PNG, JPEG or WebP image. Default: "pdf".

§page_size: Option<WebCapturePageSize>

PDF page size. Default: "A4". Used when output is pdf.

§orientation: Option<WebCaptureOrientation>

PDF orientation. Default: "portrait". Used when output is pdf.

§margin: Option<WebCaptureMargin>

PDF margin: no-margin 0, small 0.5 in, big 0.75 in. Default: "small". Used when output is pdf.

§full_page: Option<bool>

Capture the whole page (one long PDF page, or a full-length image) instead of the first screen. Default: false.

§screen_size: Option<WebCaptureScreenSize>

Browser window: desktop 1365x768, laptop 1440x900, tablet 834x1112, mobile 390x844. Default: "desktop".

§viewport_width: Option<f64>

Exact window width; overrides screenSize. Range: 320 to 2400 px.

§viewport_height: Option<f64>

Exact window height; overrides screenSize. Range: 240 to 2400 px.

§delay_ms: Option<f64>

Wait after the page loads before capturing (an image waits 250 ms when this is omitted). Range: 0 to 3000 ms.

§quality: Option<f64>

JPEG or WebP quality. Default: 86. Range: 1 to 100 %. Used when output is jpeg or webp.

§transparent_background: Option<bool>

Keep a transparent background. Default: false. Used when output is png.

§block_ads: Option<bool>

Try to block advertising requests. Default: false. Used when output is pdf.

§remove_overlays: Option<bool>

Try to remove pop-up overlays from a captured web address. Default: false. Used when output is pdf.

§output_name: Option<String>

Output file name without a path; the extension is added for you.

§extra: Object

Further parameters this SDK version does not model.

Trait Implementations§

Source§

impl Clone for WebCaptureParams

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for WebCaptureParams

Source§

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

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

impl Default for WebCaptureParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for WebCaptureParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<WebCaptureParams> for ToolParameters

Source§

fn from(params: WebCaptureParams) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for WebCaptureParams

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for WebCaptureParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for WebCaptureParams

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> MaybeSendSync for T

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more