PdfEmbeddedFileSpecificationTree Class
Represents a name tree mapping name PdfStrings to PdfFileSpecifications for PdfEmbeddedFiles (see 7.11.4, "Embedded File Streams").
public sealed class PdfEmbeddedFileSpecificationTree : PdfTree<PdfString, PdfFileSpecification>, IList, ICollection, IList<KeyValuePair<PdfString, PdfFileSpecification>>, ICollection<KeyValuePair<PdfString, PdfFileSpecification>>, IEnumerable<KeyValuePair<PdfString, PdfFileSpecification>>, IEnumerable
Public NotInheritable Class PdfEmbeddedFileSpecificationTree
Inherits PdfTree(Of PdfString, PdfFileSpecification)
Implements IList, ICollection, IList(Of KeyValuePair(Of PdfString, PdfFileSpecification)), ICollection(Of KeyValuePair(Of PdfString, PdfFileSpecification)), IEnumerable(Of KeyValuePair(Of PdfString, PdfFileSpecification)), IEnumerable
- Inheritance:
- System.ObjectPdfEmbeddedFileSpecificationTree
Implements
Methods
Add(String)
Adds a new PdfFileSpecification with the EmbeddedFile copied from the resource specified by the filePath
.
public KeyValuePair<PdfString, PdfFileSpecification> Add(string filePath)
Public Function Add(filePath As String) As KeyValuePair(Of PdfString, PdfFileSpecification)
Parameters
filePath
- System.String
The location of the resource copied to the EmbeddedFile of a newly added PdfFileSpecification. This value is also used to resolve the Name and a key in the PdfEmbeddedFileSpecificationTree of a newly added PdfFileSpecification.
Returns
- System.Collections.Generic.KeyValuePair<PdfString, PdfFileSpecification>
A newly created PdfFileSpecification with the EmbeddedFile copied from the resource specified by the filePath
added to the PdfEmbeddedFileSpecificationTree under the returned key.
Remarks
The EmbeddedFile's Size, CreationDate, ModificationDate, and MediaType properties are automatically set, if they can be resolved from the resource specified by the filePath
.
Exceptions
- System.ArgumentNullException
filePath
is null or System.String.Empty.
- System.ArgumentException
A PdfFileSpecification with the same key already exists in the PdfEmbeddedFileSpecificationTree.
AddEmpty(String)
Add a new PdfFileSpecification with the specified name and an empty EmbeddedFile.
Use the OpenWrite(Boolean) method of the EmbeddedFile of a returned PdfFileSpecification to fill the empty EmbeddedFile.
public KeyValuePair<PdfString, PdfFileSpecification> AddEmpty(string fileSpecificationName)
Public Function AddEmpty(fileSpecificationName As String) As KeyValuePair(Of PdfString, PdfFileSpecification)
Parameters
fileSpecificationName
- System.String
The name of a newly added PdfFileSpecification. This value is also used to resolve a key in the PdfEmbeddedFileSpecificationTree of a newly added PdfFileSpecification.
Returns
- System.Collections.Generic.KeyValuePair<PdfString, PdfFileSpecification>
A newly created PdfFileSpecification with the specified name and an empty EmbeddedFile added to the PdfEmbeddedFileSpecificationTree under the returned key.
Exceptions
- System.ArgumentNullException
fileSpecificationName
is null or System.String.Empty.
- System.ArgumentException
A PdfFileSpecification with the same key already exists in the PdfEmbeddedFileSpecificationTree.
Inherited Properties
Count | Gets the number of elements contained in the PdfCollection. (Inherited from PdfCollection) |
Metadata | (Optional; PDF 1.4) A metadata stream containing metadata for the component. (Inherited from PdfObject) |
Inherited Methods
Clear() | Removes all elements from the PdfCollection. (Inherited from PdfCollection) |
RemoveAt(System.Int32) | Removes the element at the specified index of the PdfCollection. (Inherited from PdfCollection) |