• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class EmbeddedFileCollection

Collection of files embedded in a PDF document. Serialized into the catalog's /Names /EmbeddedFiles entry on Save.

Inheritance
object
EmbeddedFileCollection
Implements
IEnumerable<EmbeddedFile>
IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Pdf.EmbeddedFiles
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
Type Description
int

Files

All embedded files in this collection.

Declaration
public IReadOnlyList<EmbeddedFile> Files { get; }
Property Value
Type Description
IReadOnlyList<EmbeddedFile>

HasFiles

Whether any files have been added.

Declaration
public bool HasFiles { get; }
Property Value
Type Description
bool

this[int]

Indexed file accessor.

Declaration
public EmbeddedFile this[int index] { get; }
Parameters
Type Name Description
int index
Property Value
Type Description
EmbeddedFile

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
Type Description
EmbeddedFile

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
Type Name Description
string name
Stream stream
string mimeType
Returns
Type Description
EmbeddedFile

Add(string, string)

Embed the file at filePath under the given name.

Declaration
public EmbeddedFile Add(string name, string filePath)
Parameters
Type Name Description
string name
string filePath
Returns
Type Description
EmbeddedFile

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
Type Name Description
string name
string mimeType
Returns
Type Description
EmbeddedFile

Clear()

Remove all embedded files.

Declaration
public void Clear()

GetEnumerator()

Returns an enumerator that iterates through the embedded files.

Declaration
public IEnumerator<EmbeddedFile> GetEnumerator()
Returns
Type Description
IEnumerator<EmbeddedFile>

Remove(EmbeddedFile)

Remove a specific embedded file entry.

Declaration
public bool Remove(EmbeddedFile file)
Parameters
Type Name Description
EmbeddedFile file
Returns
Type Description
bool

Remove(string, StringComparison)

Remove the first embedded file entry whose name matches name.

Declaration
public bool Remove(string name, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
Parameters
Type Name Description
string name
StringComparison comparison
Returns
Type Description
bool

RemoveAt(int)

Remove an embedded file by zero-based index.

Declaration
public void RemoveAt(int index)
Parameters
Type Name Description
int index

Implements

IEnumerable<T>
IEnumerable
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX