pub struct Action<'a> { /* private fields */ }
Expand description
Writer for an action dictionary.
This struct is created by Annotation::action
and many keys of
AdditionalActions
.
Implementations§
source§impl<'a> Action<'a>
impl<'a> Action<'a>
sourcepub fn action_type(&mut self, kind: ActionType) -> &mut Self
pub fn action_type(&mut self, kind: ActionType) -> &mut Self
Write the /S
attribute to set the action type.
sourcepub fn destination(&mut self) -> Destination<'_>
pub fn destination(&mut self) -> Destination<'_>
Start writing the /D
attribute to set the destination of this
GoTo-type action.
sourcepub fn destination_named(&mut self, name: Name<'_>) -> &mut Self
pub fn destination_named(&mut self, name: Name<'_>) -> &mut Self
Write the /D
attribute to set the destination of this GoTo-type action
to a named destination.
sourcepub fn file_spec(&mut self) -> FileSpec<'_>
pub fn file_spec(&mut self) -> FileSpec<'_>
Start writing the /F
attribute, depending on the ActionType
, setting:
RemoteGoTo
: which file to go toLaunch
: which application to launchSubmitForm
: script location of the webserver that processes the submissionImportData
: the FDF file from which to import data.
sourcepub fn new_window(&mut self, new: bool) -> &mut Self
pub fn new_window(&mut self, new: bool) -> &mut Self
Write the /NewWindow
attribute to set whether this remote GoTo action
should open the referenced destination in another window.
sourcepub fn uri(&mut self, uri: Str<'_>) -> &mut Self
pub fn uri(&mut self, uri: Str<'_>) -> &mut Self
Write the /URI
attribute to set where this link action goes.
sourcepub fn is_map(&mut self, map: bool) -> &mut Self
pub fn is_map(&mut self, map: bool) -> &mut Self
Write the /IsMap
attribute to set if the click position of the user’s
cursor inside the link rectangle should be appended to the referenced
URI as a query parameter.
sourcepub fn js_string(&mut self, script: TextStr<'_>) -> &mut Self
pub fn js_string(&mut self, script: TextStr<'_>) -> &mut Self
Write the /JS
attribute to set the script of this action as a text
string. Only permissible for JavaScript and Rendition actions.
sourcepub fn js_stream(&mut self, script: Ref) -> &mut Self
pub fn js_stream(&mut self, script: Ref) -> &mut Self
Write the /JS
attribute to set the script of this action as a text
stream. The indirect reference shall point to a stream containing valid
ECMAScript. The stream must have PdfDocEncoding
or be in Unicode,
starting with U+FEFF
. Only permissible for JavaScript and Rendition
actions.
sourcepub fn fields(&mut self) -> Fields<'_>
pub fn fields(&mut self) -> Fields<'_>
Start writing the /Fields
array to set the fields which are
include/exclude when submitting a
form, resetting a form, or loading an FDF file.
sourcepub fn form_flags(&mut self, flags: FormActionFlags) -> &mut Self
pub fn form_flags(&mut self, flags: FormActionFlags) -> &mut Self
Write the /Flags
attribute to set the various characteristics of form
action.
sourcepub fn operation(&mut self, op: RenditionOperation) -> &mut Self
pub fn operation(&mut self, op: RenditionOperation) -> &mut Self
Write the /OP
attribute to set the operation to perform when the
action is triggered.
sourcepub fn annotation(&mut self, id: Ref) -> &mut Self
pub fn annotation(&mut self, id: Ref) -> &mut Self
Write the /AN
attribute to provide a reference to the screen
annotation for the operation. Required if OP is present.
Methods from Deref<Target = Dict<'a>>§
sourcepub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
pub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
Start writing a pair with an arbitrary value.
sourcepub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
pub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
Write a pair with a primitive value.
This is a shorthand for dict.insert(key).primitive(value)
.
sourcepub fn pairs<'n, T: Primitive>(
&mut self,
pairs: impl IntoIterator<Item = (Name<'n>, T)>,
) -> &mut Self
pub fn pairs<'n, T: Primitive>( &mut self, pairs: impl IntoIterator<Item = (Name<'n>, T)>, ) -> &mut Self
Write a sequence of pairs with primitive values.