pub struct FileSpec {
pub file_system: Option<String>,
pub filename: Option<String>,
pub unicode_filename: Option<String>,
pub dos_filename: Option<String>,
pub unix_filename: Option<String>,
pub embedded_file: Option<ObjectId>,
pub description: Option<String>,
pub data: Option<Vec<u8>>,
}Expand description
A parsed PDF file specification dictionary.
Fields§
§file_system: Option<String>File system name (/FS).
filename: Option<String>Platform-independent filename (/F).
unicode_filename: Option<String>Unicode filename (/UF).
dos_filename: Option<String>DOS filename (/DOS).
unix_filename: Option<String>Unix filename (/Unix).
embedded_file: Option<ObjectId>Indirect reference to the embedded file stream (from /EF sub-dict /F).
description: Option<String>Description of the file (/Desc).
data: Option<Vec<u8>>Decoded bytes of the embedded file stream, if available.
Populated during parsing from the /EF /F stream when the
ObjectStore can decode it. Corresponds to the buffer returned by
FPDFAttachment_GetUnderlyingFile.
Implementations§
Source§impl FileSpec
impl FileSpec
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Returns the best available filename for this attachment.
Prefers the Unicode filename (/UF) over the platform-encoded filename
(/F), with further fallbacks to Unix and DOS filenames.
Corresponds to FPDFAttachment_GetName.
Sourcepub fn attachment_get_name(&self) -> Option<&str>
pub fn attachment_get_name(&self) -> Option<&str>
ADR-019 T2 alias for name().
Corresponds to FPDFAttachment_GetName.
Sourcepub fn get_name(&self) -> Option<&str>
👎Deprecated: use attachment_get_name() — matches upstream FPDFAttachment_GetName
pub fn get_name(&self) -> Option<&str>
use attachment_get_name() — matches upstream FPDFAttachment_GetName
Deprecated — use attachment_get_name().
Corresponds to FPDFAttachment_GetName.
Sourcepub fn file_data(&self) -> Option<&[u8]>
pub fn file_data(&self) -> Option<&[u8]>
Returns the decoded bytes of the embedded file stream, if available.
This is the primary data accessor for the embedded file content.
Returns None if no embedded file data is present or if decoding
failed during parsing.
Corresponds to FPDFAttachment_GetFile.
Sourcepub fn attachment_get_file(&self) -> Option<&[u8]>
pub fn attachment_get_file(&self) -> Option<&[u8]>
ADR-019 T2 alias for file_data().
Corresponds to FPDFAttachment_GetFile.
Sourcepub fn get_file(&self) -> Option<&[u8]>
👎Deprecated: use attachment_get_file() — matches upstream FPDFAttachment_GetFile
pub fn get_file(&self) -> Option<&[u8]>
use attachment_get_file() — matches upstream FPDFAttachment_GetFile
Deprecated — use attachment_get_file().
Corresponds to FPDFAttachment_GetFile.
Sourcepub fn subtype(&self) -> Option<&str>
pub fn subtype(&self) -> Option<&str>
Returns the MIME type (Subtype) of the embedded file, if present.
Reads the /Subtype entry from the embedded file stream dictionary.
Returns None if no subtype is recorded.
Corresponds to FPDFAttachment_GetSubtype.
Note: FileSpec is parsed from the file specification dictionary; the
subtype lives in the embedded file stream (/EF /F stream dict /Subtype).
This field is not currently extracted during parsing — None is always
returned in this release.
Sourcepub fn get_subtype(&self) -> Option<&str>
👎Deprecated: use subtype() — there is no public FPDFAttachment_GetSubtype API
pub fn get_subtype(&self) -> Option<&str>
use subtype() — there is no public FPDFAttachment_GetSubtype API
Deprecated — use subtype() — no public FPDFAttachment_GetSubtype API.
Sourcepub fn underlying_bytes(&self) -> Option<&[u8]>
pub fn underlying_bytes(&self) -> Option<&[u8]>
Returns the raw decoded bytes of the embedded file, if available.
This is populated during document parsing when the embedded file stream
can be decoded. Returns None if no embedded file data is present or
if decoding failed during parsing.
Corresponds to FPDFAttachment_GetUnderlyingFile.
Sourcepub fn get_underlying_bytes(&self) -> Option<&[u8]>
👎Deprecated: use underlying_bytes() — there is no public FPDFAttachment_GetUnderlyingFile API
pub fn get_underlying_bytes(&self) -> Option<&[u8]>
use underlying_bytes() — there is no public FPDFAttachment_GetUnderlyingFile API
Deprecated — use underlying_bytes() — no public FPDF_* API.
Sourcepub fn set_filename(&mut self, filename: &str) -> DocResult<()>
pub fn set_filename(&mut self, filename: &str) -> DocResult<()>
Set the filename.
Updates both the PDF-encoded /F filename and the Unicode /UF filename
in memory. To persist the change to a PDF file, use EditDocument in
rpdfium-edit.
Sourcepub fn best_filename(&self) -> Option<&str>
👎Deprecated since 0.1.0: use name() instead
pub fn best_filename(&self) -> Option<&str>
use name() instead
Returns the best available filename, preferring Unicode over platform-specific.
Deprecated: use name() instead (primary) or
get_name() (upstream alias).