pub struct EmbeddedFile {
pub name: String,
pub description: Option<String>,
pub relationship: Option<String>,
pub subtype: Option<String>,
pub size: Option<i64>,
pub creation_date: Option<String>,
pub mod_date: Option<String>,
pub checksum: Option<Vec<u8>>,
pub stream: Option<ObjectId>,
pub source: EmbeddedSource,
}Expand description
One embedded or associated file: the file-specification metadata plus the
object id of its embedded-file stream (when it carries one). The payload is
not decoded here — fetch it with crate::PdfDocument::embedded_file_bytes.
Fields§
§name: StringBest available file name: /UF (Unicode) if present, else /F, else a
platform-specific name, else the name-tree key it was registered under.
May be empty if the file specification carries no name at all.
description: Option<String>/Desc — a human-readable description, if present.
relationship: Option<String>/AFRelationship (PDF 2.0): the relationship an associated file has to
the content it is attached to — Source, Data, Alternative,
Supplement, EncryptedPayload, FormData, Schema, Unspecified.
None when absent (the common case for plain name-tree attachments).
subtype: Option<String>/Subtype of the embedded-file stream — a MIME type such as
"application/xml" (the PDF name application#2Fxml). None when the
file carries no embedded stream or the stream omits /Subtype.
size: Option<i64>/Params /Size — the uncompressed size in bytes the producer declared.
Advisory: the actual decoded length is whatever the stream yields.
creation_date: Option<String>/Params /CreationDate, as the raw PDF date string (e.g. D:20240101…).
mod_date: Option<String>/Params /ModDate, as the raw PDF date string.
checksum: Option<Vec<u8>>/Params /CheckSum — a 16-byte MD5 of the uncompressed bytes, if the
producer included one. Stored raw (not decoded text).
stream: Option<ObjectId>Object id of the embedded-file stream (/EF → chosen name key). None
for an external file reference or a malformed spec with no /EF.
source: EmbeddedSourceWhether this came from the name tree or an /AF array.
Implementations§
Source§impl EmbeddedFile
impl EmbeddedFile
Sourcepub fn is_embedded(&self) -> bool
pub fn is_embedded(&self) -> bool
Whether this file specification actually has embedded bytes to extract (as opposed to merely naming an external file).
Trait Implementations§
Source§impl Clone for EmbeddedFile
impl Clone for EmbeddedFile
Source§fn clone(&self) -> EmbeddedFile
fn clone(&self) -> EmbeddedFile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more