Skip to main content

FormControl

Struct FormControl 

Source
pub struct FormControl {
Show 17 fields pub field_name: String, pub rect: Rect, pub appearance_state: Option<String>, pub page_index: Option<usize>, pub highlighting_mode: HighlightingMode, pub rotation: u32, pub border_color: Option<Vec<f32>>, pub background_color: Option<Vec<f32>>, pub caption: Option<String>, pub rollover_caption: Option<String>, pub alt_caption: Option<String>, pub default_appearance: Option<String>, pub normal_icon: Option<ObjectId>, pub rollover_icon: Option<ObjectId>, pub down_icon: Option<ObjectId>, pub icon_fit: Option<IconFit>, pub text_position: TextPosition,
}
Expand description

A visual widget (control) for a form field.

Fields§

§field_name: String

The fully qualified name of the associated form field.

§rect: Rect

The annotation rectangle on the page.

§appearance_state: Option<String>

The current appearance state (e.g., “Yes”, “Off”).

§page_index: Option<usize>

Zero-based page index, if known.

§highlighting_mode: HighlightingMode

Highlighting mode (/H).

§rotation: u32

Rotation in degrees from /MK/R (0, 90, 180, 270).

§border_color: Option<Vec<f32>>

Border color from /MK/BC.

§background_color: Option<Vec<f32>>

Background color from /MK/BG.

§caption: Option<String>

Normal caption from /MK/CA.

§rollover_caption: Option<String>

Rollover caption from /MK/RC.

§alt_caption: Option<String>

Alternate (down) caption from /MK/AC.

§default_appearance: Option<String>

Default appearance string (/DA).

§normal_icon: Option<ObjectId>

Normal icon stream reference (/MK/I).

§rollover_icon: Option<ObjectId>

Rollover icon stream reference (/MK/RI).

§down_icon: Option<ObjectId>

Down (alternate) icon stream reference (/MK/IX).

§icon_fit: Option<IconFit>

Icon fit parameters (/MK/IF).

§text_position: TextPosition

Text/icon positioning (/MK/TP).

Implementations§

Source§

impl FormControl

Source

pub fn rect(&self) -> Rect

Returns the annotation rectangle on the page.

Corresponds to CPDF_FormControl::GetRect() in PDFium.

Source

pub fn get_rect(&self) -> Rect

👎Deprecated:

use rect() — there is no public FPDF_* API (internal CPDF_FormControl::GetRect)

Deprecated — use rect() — no public FPDFFormControl_GetRect API.

Source

pub fn checked_ap_state(&self) -> Option<&str>

Returns the current checked appearance state name (e.g., "Yes", "Off").

Corresponds to CPDF_FormControl::GetCheckedAPState() in PDFium.

Source

pub fn get_checked_ap_state(&self) -> Option<&str>

👎Deprecated:

use checked_ap_state() — there is no public FPDF_* API (internal CPDF_FormControl::GetCheckedAPState)

Deprecated — use checked_ap_state() — no public FPDF_* API.

Source

pub fn export_value(&self) -> Option<&str>

Returns the export value for a radio/checkbox button option.

For checkbox and radio button controls, returns the appearance state name used when the button is in its on state. Corresponds to CPDF_FormControl::GetExportValue() in PDFium.

Source

pub fn get_export_value(&self) -> Option<&str>

👎Deprecated:

use export_value() — there is no public FPDF_* API (internal CPDF_FormControl::GetExportValue)

Deprecated — use export_value() — no public FPDF_* API.

Source

pub fn highlighting_mode(&self) -> HighlightingMode

Returns the highlighting mode for this widget.

Corresponds to CPDF_FormControl::GetHighlightingMode() in PDFium.

Source

pub fn get_highlighting_mode(&self) -> HighlightingMode

👎Deprecated:

use highlighting_mode() — there is no public FPDF_* API (internal CPDF_FormControl::GetHighlightingMode)

Deprecated — use highlighting_mode() — no public FPDF_* API.

Source

pub fn rotation(&self) -> u32

Returns the rotation angle in degrees (0, 90, 180, or 270).

Corresponds to CPDF_FormControl::GetRotation() in PDFium.

Source

pub fn get_rotation(&self) -> u32

👎Deprecated:

use rotation() — there is no public FPDF_* API (internal CPDF_FormControl::GetRotation)

Deprecated — use rotation() — no public FPDF_* API.

Source

pub fn normal_caption(&self) -> Option<&str>

Returns the normal (default) caption string for this widget.

Corresponds to CPDF_FormControl::GetNormalCaption() in PDFium.

Source

pub fn get_normal_caption(&self) -> Option<&str>

👎Deprecated:

use normal_caption() — there is no public FPDF_* API (internal CPDF_FormControl::GetNormalCaption)

Deprecated — use normal_caption() — no public FPDF_* API.

Source

pub fn rollover_caption(&self) -> Option<&str>

Returns the rollover (hover) caption string for this widget.

Corresponds to CPDF_FormControl::GetRolloverCaption() in PDFium.

Source

pub fn get_rollover_caption(&self) -> Option<&str>

👎Deprecated:

use rollover_caption() — there is no public FPDF_* API (internal CPDF_FormControl::GetRolloverCaption)

Deprecated — use rollover_caption() — no public FPDF_* API.

Source

pub fn down_caption(&self) -> Option<&str>

Returns the down (pressed) caption string for this widget.

Corresponds to CPDF_FormControl::GetDownCaption() in PDFium.

Source

pub fn get_down_caption(&self) -> Option<&str>

👎Deprecated:

use down_caption() — there is no public FPDF_* API (internal CPDF_FormControl::GetDownCaption)

Deprecated — use down_caption() — no public FPDF_* API.

Source

pub fn text_position(&self) -> TextPosition

Returns the text/icon position for this widget (TP value, 0–6).

Corresponds to CPDF_FormControl::GetTextPosition() in PDFium.

Source

pub fn get_text_position(&self) -> TextPosition

👎Deprecated:

use text_position() — there is no public FPDF_* API (internal CPDF_FormControl::GetTextPosition)

Deprecated — use text_position() — no public FPDF_* API.

Source

pub fn is_checked(&self) -> bool

Returns true if the control’s appearance state is “Yes” (checked).

Source

pub fn is_default_checked(&self) -> bool

Returns true if the default appearance state is “Yes”.

Note: We use /AS for the current state. Default checked state would typically come from /DV on the parent field.

Tier-1 primary: calls another rpdfium function (is_checked()), so #[inline] must not be applied.

Source

pub fn border_color_argb(&self) -> Option<u32>

Returns the border color as a packed ARGB value (0xAARRGGBB), or None if no border color is defined.

Supports grayscale (1 component) and RGB (3 component) color arrays. Returns None for CMYK (4 components) or an empty array.

Corresponds to CPDF_FormControl::GetColorARGB() in PDFium (nIndex=0).

Source

pub fn background_color_argb(&self) -> Option<u32>

Returns the background color as a packed ARGB value (0xAARRGGBB), or None if no background color is defined.

Supports grayscale (1 component) and RGB (3 component) color arrays. Returns None for CMYK (4 components) or an empty array.

Corresponds to CPDF_FormControl::GetColorARGB() in PDFium (nIndex=1).

Trait Implementations§

Source§

impl Clone for FormControl

Source§

fn clone(&self) -> FormControl

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 FormControl

Source§

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

Formats the value using the given formatter. Read more

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> 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> 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 = 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.
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