PdfEmbeddedFileCollection Class
The files embedded in a document: the /EmbeddedFiles name tree of the name dictionary of the catalog (ISO 32000-2, 7.7.4, 7.11.4). The files added are also associated with the document (/AF of the catalog, 14.13), as PDF/A-3 and PDF/A-4f require.
public sealed class PdfEmbeddedFileCollection : IEnumerable<PdfEmbeddedFile>, IReadOnlyCollection<PdfEmbeddedFile>, IReadOnlyList<PdfEmbeddedFile>, IEnumerable- Implements
Properties
| Name | Description |
|---|---|
| Count | Gets the number of files. |
Indexers
| Name | Description |
|---|---|
| this[int] | Gets a file. |
this[int]
PdfEmbeddedFileCollection.csGets a file.
public PdfEmbeddedFile this[int index] { get; }Methods
| Name | Description |
|---|---|
| Add(string, ReadOnlySpan<byte>, PdfEmbeddedFileOptions?) | Embeds a file in the document. |
| GetEnumerator() | Returns an enumerator over the files. |
| Remove(PdfEmbeddedFile) | Removes a file from the document: from the name tree and from the files associated with the document. |
| System.Collections.IEnumerable.GetEnumerator() |
Add(string, ReadOnlySpan<byte>, PdfEmbeddedFileOptions?)
PdfEmbeddedFileCollection.csEmbeds a file in the document.
public PdfEmbeddedFile Add(string fileName, ReadOnlySpan<byte> data, PdfEmbeddedFileOptions? options = null)Parameters
fileNamestring- The name of the file, the key of the name tree: it is unique in the document.
dataReadOnlySpan<byte>- The content of the file.
optionsPdfEmbeddedFileOptions?- The attributes of the file, or
nullfor the defaults.
Returns
PdfEmbeddedFile The file.
Exceptions
ArgumentExceptionfileNameis empty or the name of another file of the document, or the MIME type is not valid.
GetEnumerator()
PdfEmbeddedFileCollection.csReturns an enumerator over the files.
public IEnumerator<PdfEmbeddedFile> GetEnumerator()Returns
IEnumerator<PdfEmbeddedFile> The enumerator.
Remove(PdfEmbeddedFile)
PdfEmbeddedFileCollection.csRemoves a file from the document: from the name tree and from the files associated with the document.
public bool Remove(PdfEmbeddedFile file)