PdfEmbeddedFile Class
A file embedded in a document (ISO 32000-2, 7.11.4): a file specification dictionary whose embedded file stream holds the bytes of the file. The files of the document are in PdfDocument.EmbeddedFiles, the files of a page in its file attachment annotations (PdfFileAttachmentAnnotation).
public sealed class PdfEmbeddedFileProperties
| Name | Description |
|---|---|
| CreationDate | Gets the date the file was created (/Params /CreationDate), or null. |
| Description | Gets the description of the file (/Desc), or null. |
| Dictionary | Gets the file specification dictionary. |
| FileName | Gets the name of the file: /UF, or /F, or the key of the name tree of the document. |
| MimeType | Gets the MIME type of the file (/Subtype of the embedded file stream), or null. |
| ModificationDate | Gets the date the file was last modified (/Params /ModDate), or null. |
| Reference | Gets the reference to the file specification, or null for a direct object. |
| Relationship | Gets how the file relates to the content of the document (/AFRelationship); PdfAssociatedFileRelationship.Unspecified when it is missing or unknown. |
| Size | Gets the size of the file in bytes (/Params /Size), or null when the file does not give it. |
CreationDate
PdfEmbeddedFile.csGets the date the file was created (/Params /CreationDate), or null.
public DateTimeOffset? CreationDate { get; }Property value
Description
PdfEmbeddedFile.csDictionary
PdfEmbeddedFile.csFileName
PdfEmbeddedFile.csMimeType
PdfEmbeddedFile.csModificationDate
PdfEmbeddedFile.csGets the date the file was last modified (/Params /ModDate), or null.
public DateTimeOffset? ModificationDate { get; }Property value
Reference
PdfEmbeddedFile.csGets the reference to the file specification, or null for a direct object.
public PdfReference? Reference { get; }Property value
Relationship
PdfEmbeddedFile.csGets how the file relates to the content of the document (/AFRelationship); PdfAssociatedFileRelationship.Unspecified when it is missing or unknown.
public PdfAssociatedFileRelationship Relationship { get; }Property value
Methods
| Name | Description |
|---|---|
| GetData() | Gets the content of the file. |
GetData()
PdfEmbeddedFile.csGets the content of the file.
public byte[] GetData()Returns
byte[] The bytes of the file.
Exceptions
InvalidPdfContentException- The file specification has no embedded file stream, or the stream cannot be decoded.
PdfResourceLimitException- The decoded file exceeds
PdfReadOptions.MaxDecodedStreamLength.