pub struct FileSpec<'a> { /* private fields */ }
Expand description
Writer for a file specification dictionary.
This struct is created by Annotation::file_spec
,
Reference::file_spec
, MediaClip::data
, and Action::file_spec
.
Implementations§
source§impl<'a> FileSpec<'a>
impl<'a> FileSpec<'a>
sourcepub fn file_system(&mut self, system: Name<'_>) -> &mut Self
pub fn file_system(&mut self, system: Name<'_>) -> &mut Self
Write the /FS
attribute to set the file system this entry relates to.
If you set the system
argument to Name(b"URL")
, this becomes an URL
specification.
sourcepub fn path(&mut self, path: Str<'_>) -> &mut Self
pub fn path(&mut self, path: Str<'_>) -> &mut Self
Write the /F
attribute to set the file path. Directories are indicated
by /
, independent of the platform.
sourcepub fn unic_file(&mut self, path: TextStr<'_>) -> &mut Self
pub fn unic_file(&mut self, path: TextStr<'_>) -> &mut Self
Write the /UF
attribute to set a Unicode-compatible path. Directories
are indicated by /
, independent of the platform. PDF 1.7+.
sourcepub fn volatile(&mut self, dont_cache: bool) -> &mut Self
pub fn volatile(&mut self, dont_cache: bool) -> &mut Self
Write the /V
attribute to indicate whether not to cache the file.
sourcepub fn description(&mut self, desc: TextStr<'_>) -> &mut Self
pub fn description(&mut self, desc: TextStr<'_>) -> &mut Self
Write the /Desc
attribute to set a file description. PDF 1.6+.
sourcepub fn embedded_file(&mut self, id: Ref) -> &mut Self
pub fn embedded_file(&mut self, id: Ref) -> &mut Self
Write the /EF
attribute to reference an embedded file.
PDF 1.3+.
This only sets an embedded file for the F
attribute corresponding to
the path
method. If you want to set the same embedded
file for the UF
attribute, also call Self::embedded_file_with_unicode
instead.
Note that this key is forbidden in PDF/A-1 and restricted in PDF/A-2 and PDF/A-4.
sourcepub fn embedded_file_with_unicode(&mut self, id: Ref) -> &mut Self
pub fn embedded_file_with_unicode(&mut self, id: Ref) -> &mut Self
Write the /EF
attribute to reference an embedded file
for the legacy and Unicode-compatible file path. PDF 1.7+.
Note that this key is forbidden in PDF/A-1 and restricted in PDF/A-2 an PDF/A-4.
sourcepub fn association_kind(&mut self, kind: AssociationKind) -> &mut Self
pub fn association_kind(&mut self, kind: AssociationKind) -> &mut Self
How this file relates to the PDF document it is embedded in. PDF/A-3 and PDF/A-4f.
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.