FileSpecification

FileSpecification

Overview

FileSpecification is a class in Aspose.PDF FOSS for .NET. Inherits from: IDisposable.

Represents an embedded file specification (PDF §7.11.3).

This class provides 10 methods for working with FileSpecification objects in .NET programs. Available methods include: Dispose, FileSpecification, GetData, GetValue, SetValue. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: AFRelationship, CollectionItem, Contents, Description, Encoding, EncryptedPayload, and 9 more.

Properties

NameTypeAccessDescription
NamestringRead/WriteThe file name.
Descriptionstring?Read/WriteThe file description.
ContentsStream?Read/WriteStream for reading or setting the embedded file data.
StreamContentsStream?ReadAlias for Contents.
MimeTypestring?Read/WriteThe MIME type (from /Subtype of the embedded file stream).
MIMETypestring?Read/WriteAlias for MimeType naming.
ParamsFileParamsRead/WriteThe /Params dict on the embedded-file stream, wrapped as a FileParams.
UnicodeNamestring?Read/WriteUTF-16 file name (/UF entry, PDF 2.0 preferred over /F).
FileSystemstring?Read/WriteFile-system identifier carried in /FS.
IncludeContentsboolRead/WriteWhen true, the file spec carries an embedded-file stream (/EF entry).
AFRelationshipAFRelationshipRead/WriteRelationship between the embedded file and the document content that references it (/AFRelationship, PDF 2.0 §7.11.3).
EncodingFileEncodingRead/WriteCompression applied to the embedded stream’s data when the spec is added to a document: Zip stores it FlateDecode-compressed, None stores it raw.
EncryptedPayloadEncryptedPayloadReadEncrypted-payload metadata (PDF 2.0 unencrypted-wrapper support).
CollectionItemCollectionItemReadSchema-driven collection metadata (portfolio /Collection items).
Sizelong?ReadThe uncompressed size of the embedded file (legacy alias — see FileParams for the proper accessor).

Methods

SignatureDescription
FileSpecification()Empty file specification with no backing file or stream.
FileSpecification(file: string)Create a new file specification for embedding a file (no description).
FileSpecification(file: string, description: string)Create a new file specification for embedding a file.
FileSpecification(fileName: string, annot: Aspose.Pdf.Annotations.Annotation)Create a file specification linked to a file-attachment annot.
FileSpecification(stream: Stream, name: string)Create a new file specification for embedding a stream (no description).
FileSpecification(stream: Stream, name: string, description: string)Create a new file specification for embedding a stream.
GetData()Get the embedded file data as a byte array.
GetValue(key: string)Read a custom name/value pair previously set via SetValue(string, string).
SetValue(key: string, value: string)Store a custom name/value pair on the spec.
Dispose()Releases resources held by the file spec.

See Also