pub struct MediaClip<'a> { /* private fields */ }
Expand description
Writer for an media clip dictionary.
This struct is created by Rendition::media_clip
.
§Note on reader compatibility
Different PDF readers may have support for different media codecs and container formats.
For example, Adobe’s documentation states that Adobe Acrobat can play videos in MP4, MOV, M4V, 3GP, and 3G2 containers using the H.264 codec.
Other readers may depend on the media libraries installed on the system. KDE Okular, for example, uses the Phonon library to support a range of media formats.
Yet other viewers do not support media clips at all. At the time of writing,
this includes the popular Pdfium library used by Google Chrome and Microsoft
Edge, pdf.js
used by Firefox, mupdf, and Quartz, the PDF viewer on Apple
platforms.
Implementations§
source§impl<'a> MediaClip<'a>
impl<'a> MediaClip<'a>
sourcepub fn subtype(&mut self, kind: MediaClipType) -> &mut Self
pub fn subtype(&mut self, kind: MediaClipType) -> &mut Self
Write the /S
attribute to set the media clip type.
sourcepub fn name(&mut self, text: TextStr<'_>) -> &mut Self
pub fn name(&mut self, text: TextStr<'_>) -> &mut Self
Write the /N
attribute. Specifies the name of the media clip, for use
in the user interface.
sourcepub fn data(&mut self) -> FileSpec<'_>
pub fn data(&mut self) -> FileSpec<'_>
Start writing the /D
dictionary specifying the media data.
sourcepub fn data_type(&mut self, tf: Str<'_>) -> &mut Self
pub fn data_type(&mut self, tf: Str<'_>) -> &mut Self
Write the /CT
attribute identifying the type of data in /D
, i.e. the
MIME type.
sourcepub fn permissions(&mut self) -> MediaPermissions<'_>
pub fn permissions(&mut self) -> MediaPermissions<'_>
Start writing the /P
, i.e. media permissions, dictionary.
sourcepub fn alt_texts<'b>(
&mut self,
texts: impl IntoIterator<Item = TextStr<'b>>,
) -> &mut Self
pub fn alt_texts<'b>( &mut self, texts: impl IntoIterator<Item = TextStr<'b>>, ) -> &mut Self
Write the /Alt
attribute, listing alternate text descriptions which
are specified as a multi-language text array. A multi-language text
array shall contain pairs of strings.
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.