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: StringThe fully qualified name of the associated form field.
rect: RectThe 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: HighlightingModeHighlighting mode (/H).
rotation: u32Rotation 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: TextPositionText/icon positioning (/MK → /TP).
Implementations§
Source§impl FormControl
impl FormControl
Sourcepub fn rect(&self) -> Rect
pub fn rect(&self) -> Rect
Returns the annotation rectangle on the page.
Corresponds to CPDF_FormControl::GetRect() in PDFium.
Sourcepub fn get_rect(&self) -> Rect
👎Deprecated: use rect() — there is no public FPDF_* API (internal CPDF_FormControl::GetRect)
pub fn get_rect(&self) -> Rect
use rect() — there is no public FPDF_* API (internal CPDF_FormControl::GetRect)
Deprecated — use rect() — no public FPDFFormControl_GetRect API.
Sourcepub fn checked_ap_state(&self) -> Option<&str>
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.
Sourcepub fn get_checked_ap_state(&self) -> Option<&str>
👎Deprecated: use checked_ap_state() — there is no public FPDF_* API (internal CPDF_FormControl::GetCheckedAPState)
pub fn get_checked_ap_state(&self) -> Option<&str>
use checked_ap_state() — there is no public FPDF_* API (internal CPDF_FormControl::GetCheckedAPState)
Deprecated — use checked_ap_state() — no public FPDF_* API.
Sourcepub fn export_value(&self) -> Option<&str>
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.
Sourcepub fn get_export_value(&self) -> Option<&str>
👎Deprecated: use export_value() — there is no public FPDF_* API (internal CPDF_FormControl::GetExportValue)
pub fn get_export_value(&self) -> Option<&str>
use export_value() — there is no public FPDF_* API (internal CPDF_FormControl::GetExportValue)
Deprecated — use export_value() — no public FPDF_* API.
Sourcepub fn highlighting_mode(&self) -> HighlightingMode
pub fn highlighting_mode(&self) -> HighlightingMode
Returns the highlighting mode for this widget.
Corresponds to CPDF_FormControl::GetHighlightingMode() in PDFium.
Sourcepub fn get_highlighting_mode(&self) -> HighlightingMode
👎Deprecated: use highlighting_mode() — there is no public FPDF_* API (internal CPDF_FormControl::GetHighlightingMode)
pub fn get_highlighting_mode(&self) -> HighlightingMode
use highlighting_mode() — there is no public FPDF_* API (internal CPDF_FormControl::GetHighlightingMode)
Deprecated — use highlighting_mode() — no public FPDF_* API.
Sourcepub fn rotation(&self) -> u32
pub fn rotation(&self) -> u32
Returns the rotation angle in degrees (0, 90, 180, or 270).
Corresponds to CPDF_FormControl::GetRotation() in PDFium.
Sourcepub fn get_rotation(&self) -> u32
👎Deprecated: use rotation() — there is no public FPDF_* API (internal CPDF_FormControl::GetRotation)
pub fn get_rotation(&self) -> u32
use rotation() — there is no public FPDF_* API (internal CPDF_FormControl::GetRotation)
Deprecated — use rotation() — no public FPDF_* API.
Sourcepub fn normal_caption(&self) -> Option<&str>
pub fn normal_caption(&self) -> Option<&str>
Returns the normal (default) caption string for this widget.
Corresponds to CPDF_FormControl::GetNormalCaption() in PDFium.
Sourcepub fn get_normal_caption(&self) -> Option<&str>
👎Deprecated: use normal_caption() — there is no public FPDF_* API (internal CPDF_FormControl::GetNormalCaption)
pub fn get_normal_caption(&self) -> Option<&str>
use normal_caption() — there is no public FPDF_* API (internal CPDF_FormControl::GetNormalCaption)
Deprecated — use normal_caption() — no public FPDF_* API.
Sourcepub fn rollover_caption(&self) -> Option<&str>
pub fn rollover_caption(&self) -> Option<&str>
Returns the rollover (hover) caption string for this widget.
Corresponds to CPDF_FormControl::GetRolloverCaption() in PDFium.
Sourcepub fn get_rollover_caption(&self) -> Option<&str>
👎Deprecated: use rollover_caption() — there is no public FPDF_* API (internal CPDF_FormControl::GetRolloverCaption)
pub fn get_rollover_caption(&self) -> Option<&str>
use rollover_caption() — there is no public FPDF_* API (internal CPDF_FormControl::GetRolloverCaption)
Deprecated — use rollover_caption() — no public FPDF_* API.
Sourcepub fn down_caption(&self) -> Option<&str>
pub fn down_caption(&self) -> Option<&str>
Returns the down (pressed) caption string for this widget.
Corresponds to CPDF_FormControl::GetDownCaption() in PDFium.
Sourcepub fn get_down_caption(&self) -> Option<&str>
👎Deprecated: use down_caption() — there is no public FPDF_* API (internal CPDF_FormControl::GetDownCaption)
pub fn get_down_caption(&self) -> Option<&str>
use down_caption() — there is no public FPDF_* API (internal CPDF_FormControl::GetDownCaption)
Deprecated — use down_caption() — no public FPDF_* API.
Sourcepub fn text_position(&self) -> TextPosition
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.
Sourcepub fn get_text_position(&self) -> TextPosition
👎Deprecated: use text_position() — there is no public FPDF_* API (internal CPDF_FormControl::GetTextPosition)
pub fn get_text_position(&self) -> TextPosition
use text_position() — there is no public FPDF_* API (internal CPDF_FormControl::GetTextPosition)
Deprecated — use text_position() — no public FPDF_* API.
Sourcepub fn is_checked(&self) -> bool
pub fn is_checked(&self) -> bool
Returns true if the control’s appearance state is “Yes” (checked).
Sourcepub fn is_default_checked(&self) -> bool
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.
Sourcepub fn border_color_argb(&self) -> Option<u32>
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).
Sourcepub fn background_color_argb(&self) -> Option<u32>
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
impl Clone for FormControl
Source§fn clone(&self) -> FormControl
fn clone(&self) -> FormControl
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more