Class FileSpecification
A file specification (spec §7.7.4) that wraps the /Filespec dictionary.
Can reference an embedded file stream or an external file path.
Inherited Members
Namespace: DRIT.Pdf
Assembly: DRIT.Pdf.dll
Syntax
public sealed class FileSpecification
Constructors
FileSpecification(string)
Creates a file specification for an external file path.
Declaration
public FileSpecification(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
FileSpecification(string, byte[], string?)
Creates a file specification with embedded content.
Declaration
public FileSpecification(string name, byte[] content, string? mimeType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| byte[] | content | |
| string | mimeType |
Properties
Description
Optional description (written to /Desc).
Declaration
public string? Description { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
HasEmbeddedFile
Whether this specification has embedded file content.
Declaration
public bool HasEmbeddedFile { get; }
Property Value
| Type | Description |
|---|---|
| bool |
MimeType
Optional MIME type for the embedded file stream.
Declaration
public string? MimeType { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ModificationDate
Optional modification date for the embedded file params.
Declaration
public DateTimeOffset? ModificationDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset? |
Name
The file name or path (written to /F and /UF).
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Relationship
Optional relationship for associated files (written to /AFRelationship).
Declaration
public AssociatedFileRelationshipType? Relationship { get; set; }
Property Value
| Type | Description |
|---|---|
| AssociatedFileRelationshipType? |
Size
Uncompressed file size. If null, content length is used on save.
Declaration
public int? Size { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Methods
OpenRead()
Open the embedded file content for reading, if available.
Declaration
public Stream? OpenRead()
Returns
| Type | Description |
|---|---|
| Stream |