Class EmbeddedFileCollection
Collection of files embedded in a PDF document.
Serialized into the catalog's /Names /EmbeddedFiles entry on Save.
Inheritance
EmbeddedFileCollection
Assembly: DRIT.Pdf.dll
Syntax
public sealed class EmbeddedFileCollection : IEnumerable<EmbeddedFile>, IEnumerable
Properties
Count
Number of embedded files.
Declaration
public int Count { get; }
Property Value
Files
All embedded files in this collection.
Declaration
public IReadOnlyList<EmbeddedFile> Files { get; }
Property Value
HasFiles
Whether any files have been added.
Declaration
public bool HasFiles { get; }
Property Value
this[int]
Declaration
public EmbeddedFile this[int index] { get; }
Parameters
| Type |
Name |
Description |
| int |
index |
|
Property Value
Methods
Add(string)
Embed the file at filePath using its file name as key.
Declaration
public EmbeddedFile Add(string filePath)
Parameters
| Type |
Name |
Description |
| string |
filePath |
|
Returns
Add(string, Stream, string?)
Embed the contents of stream under the given name.
Declaration
public EmbeddedFile Add(string name, Stream stream, string? mimeType = null)
Parameters
Returns
Add(string, string)
Embed the file at filePath under the given name.
Declaration
public EmbeddedFile Add(string name, string filePath)
Parameters
Returns
AddEmpty(string, string?)
Add an empty embedded file entry and return the handle.
Write bytes with OpenWrite(bool).
Declaration
public EmbeddedFile AddEmpty(string name, string? mimeType = null)
Parameters
Returns
Clear()
Remove all embedded files.
Declaration
GetEnumerator()
Returns an enumerator that iterates through the embedded files.
Declaration
public IEnumerator<EmbeddedFile> GetEnumerator()
Returns
Remove(EmbeddedFile)
Remove a specific embedded file entry.
Declaration
public bool Remove(EmbeddedFile file)
Parameters
Returns
Remove(string, StringComparison)
Remove the first embedded file entry whose name matches name.
Declaration
public bool Remove(string name, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
Parameters
Returns
RemoveAt(int)
Remove an embedded file by zero-based index.
Declaration
public void RemoveAt(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
|
Implements