Class EmbeddedFile
A file embedded in a PDF document (PDF spec §7.11.4). Obtain an instance via Add(string).
Inherited Members
Namespace: DRIT.Pdf.EmbeddedFiles
Assembly: DRIT.Pdf.dll
Syntax
public sealed class EmbeddedFile
Properties
CompressedSize
Compressed size (updated on save).
Declaration
public int CompressedSize { get; }
Property Value
| Type | Description |
|---|---|
| int |
Description
Optional file description (written to Filespec /Desc).
Declaration
public string? Description { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
MimeType
Optional MIME type (e.g. "application/json").
Declaration
public string? MimeType { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ModificationDate
Optional modification timestamp written to embedded-file /Params /ModDate.
Declaration
public DateTimeOffset? ModificationDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset? |
Name
The file name used in the embedded-file tree.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Size
Uncompressed file size. If null, current content length is used.
Declaration
public int? Size { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Methods
OpenRead()
Open the embedded file content for reading.
Declaration
public Stream OpenRead()
Returns
| Type | Description |
|---|---|
| Stream |
OpenWrite(bool)
Open the embedded file content for writing. Updated bytes are committed when the returned stream is disposed.
Declaration
public Stream OpenWrite(bool compress = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | compress |
Returns
| Type | Description |
|---|---|
| Stream |