pub struct PdfFormTextField<'a> { /* private fields */ }Expand description
A single PdfFormField of type PdfFormFieldType::Text. The form field object defines an interactive data entry widget that allows the user to enter data by typing.
Form fields in Pdfium are wrapped inside page annotations of type PdfPageAnnotationType::Widget or PdfPageAnnotationType::XfaWidget. User-specified values can be retrieved directly from each form field object by unwrapping the form field from the annotation, or in bulk from the PdfForm::field_values() function.
Implementations§
Source§impl<'a> PdfFormTextField<'a>
impl<'a> PdfFormTextField<'a>
Sourcepub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings
pub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings
Returns the PdfiumLibraryBindings used by this PdfFormTextField object.
Sourcepub fn value(&self) -> Option<String>
pub fn value(&self) -> Option<String>
Returns the value assigned to this PdfFormTextField object, if any.
Sourcepub fn set_value(&mut self, value: &str) -> Result<(), PdfiumError>
pub fn set_value(&mut self, value: &str) -> Result<(), PdfiumError>
Sets the value of this PdfFormTextField object.
Sourcepub fn is_multiline(&self) -> bool
pub fn is_multiline(&self) -> bool
Returns true if this PdfFormTextField is configured as a multi-line text field.
Sourcepub fn set_is_multiline(&self, is_multiline: bool) -> Result<(), PdfiumError>
pub fn set_is_multiline(&self, is_multiline: bool) -> Result<(), PdfiumError>
Controls whether or not this PdfFormTextField is configured as a multi-line text field.
Sourcepub fn is_password(&self) -> bool
pub fn is_password(&self) -> bool
Returns true if this PdfFormTextField is configured as a password field.
Sourcepub fn set_is_password(&self, is_password: bool) -> Result<(), PdfiumError>
pub fn set_is_password(&self, is_password: bool) -> Result<(), PdfiumError>
Controls whether or not this PdfFormTextField is configured as a password text field.
Sourcepub fn is_file_select(&self) -> bool
pub fn is_file_select(&self) -> bool
Returns true if this PdfFormTextField represents the path of a file
whose contents are to be submitted as the value of the field.
This flag was added in PDF version 1.4
Sourcepub fn set_is_file_select(
&mut self,
is_file_select: bool,
) -> Result<(), PdfiumError>
pub fn set_is_file_select( &mut self, is_file_select: bool, ) -> Result<(), PdfiumError>
Controls whether or not this PdfFormTextField represents the path of a file whose contents are to be submitted as the value of the field.
This flag was added in PDF version 1.4.
Sourcepub fn is_spell_checked(&self) -> bool
pub fn is_spell_checked(&self) -> bool
Returns true if text entered into this PdfFormTextField should be spell checked.
Sourcepub fn set_is_spell_checked(
&mut self,
is_spell_checked: bool,
) -> Result<(), PdfiumError>
pub fn set_is_spell_checked( &mut self, is_spell_checked: bool, ) -> Result<(), PdfiumError>
Controls whether or not text entered into this PdfFormTextField should be spell checked.
Sourcepub fn is_scrollable(&self) -> bool
pub fn is_scrollable(&self) -> bool
Returns true if the internal area of this PdfFormTextField can scroll either
horizontally or vertically to accommodate text entry longer than what can fit
within the field’s annotation bounds. If this value is false, then once the
field is full, no further text entry will be accepted.
This flag was added in PDF version 1.4.
Sourcepub fn set_is_scrollable(
&mut self,
is_scrollable: bool,
) -> Result<(), PdfiumError>
pub fn set_is_scrollable( &mut self, is_scrollable: bool, ) -> Result<(), PdfiumError>
Controls whether or not the internal area of this PdfFormTextField can scroll
either horizontally or vertically to accommodate text entry longer than what can fit
within the field’s annotation bounds. If set to false, no further text entry
will be accepted once the field’s annotation bounds are full.
This flag was added in PDF version 1.4.
Sourcepub fn is_combed(&self) -> bool
pub fn is_combed(&self) -> bool
Returns true if this PdfFormTextField is “combed”, that is, automatically divided
into equally-spaced positions (“combs”), with the text in the field laid out into
those combs.
For more information on this setting, refer to Table 8.77 of The PDF Reference (Sixth Edition, PDF Format 1.7), on page 691.
This flag was added in PDF version 1.5.
Sourcepub fn is_rich_text(&self) -> bool
pub fn is_rich_text(&self) -> bool
Returns true if the text in this PdfFormTextField is a rich text string.
This flag was added in PDF version 1.5.
Sourcepub fn set_is_rich_text(
&mut self,
is_rich_text: bool,
) -> Result<(), PdfiumError>
pub fn set_is_rich_text( &mut self, is_rich_text: bool, ) -> Result<(), PdfiumError>
Controls whether or not the text in this PdfFormTextField is a rich text string.
This flag was added in PDF version 1.5.
Trait Implementations§
Source§impl<'a> From<PdfFormTextField<'a>> for PdfFormField<'a>
impl<'a> From<PdfFormTextField<'a>> for PdfFormField<'a>
Source§fn from(field: PdfFormTextField<'a>) -> Self
fn from(field: PdfFormTextField<'a>) -> Self
Auto Trait Implementations§
impl<'a> Freeze for PdfFormTextField<'a>
impl<'a> !RefUnwindSafe for PdfFormTextField<'a>
impl<'a> !Send for PdfFormTextField<'a>
impl<'a> !Sync for PdfFormTextField<'a>
impl<'a> Unpin for PdfFormTextField<'a>
impl<'a> !UnwindSafe for PdfFormTextField<'a>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'a, T> PdfFormFieldCommon for Twhere
T: PdfFormFieldPrivate<'a>,
impl<'a, T> PdfFormFieldCommon for Twhere
T: PdfFormFieldPrivate<'a>,
Source§fn appearance_stream(&self) -> Option<String>
fn appearance_stream(&self) -> Option<String>
Source§fn appearance_mode_value(
&self,
appearance_mode: PdfAppearanceMode,
) -> Option<String>
fn appearance_mode_value( &self, appearance_mode: PdfAppearanceMode, ) -> Option<String>
Source§fn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Source§fn set_is_read_only(&mut self, is_read_only: bool) -> Result<(), PdfiumError>
fn set_is_read_only(&mut self, is_read_only: bool) -> Result<(), PdfiumError>
Source§fn is_required(&self) -> bool
fn is_required(&self) -> bool
true if this PdfFormField must have a value at the time it is exported
by any “submit form” action. Read moreSource§fn set_is_required(&mut self, is_required: bool) -> Result<(), PdfiumError>
fn set_is_required(&mut self, is_required: bool) -> Result<(), PdfiumError>
Source§fn is_exported_on_submit(&self) -> bool
fn is_exported_on_submit(&self) -> bool
true if the value of this PdfFormField will be exported by any
“submit form” action. Read more