PdfPortfolioFileCollection Class
Represents a collection of a PdfFileSpecifications contained in the Files (root files) or some Files.
public sealed class PdfPortfolioFileCollection : PdfCollection<PdfFileSpecification>, IList, ICollection, IList<PdfFileSpecification>, ICollection<PdfFileSpecification>, IEnumerable<PdfFileSpecification>, IEnumerable
Public NotInheritable Class PdfPortfolioFileCollection
Inherits PdfCollection(Of PdfFileSpecification)
Implements IList, ICollection, IList(Of PdfFileSpecification), ICollection(Of PdfFileSpecification), IEnumerable(Of PdfFileSpecification), IEnumerable
- Inheritance:
- System.ObjectPdfPortfolioFileCollection
Implements
Remarks
This collection is a filtered view of the EmbeddedFiles that contains only PdfFileSpecifications located in the current PdfPortfolioFolder (the associated key of a PdfFileSpecification in the EmbeddedFiles has a prefix folder ID that is equal to the internal ID of the current PdfPortfolioFolder.
Methods
Add(String)
Adds a new PdfFileSpecification with the EmbeddedFile copied from the resource specified by the filePath
to EmbeddedFiles under the PdfPortfolio (root file) or parent PdfPortfolioFolder.
public PdfFileSpecification Add(string filePath)
Public Function Add(filePath As String) As 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 EmbeddedFiles of a newly added PdfFileSpecification.
Returns
A newly created PdfFileSpecification with the EmbeddedFile copied from the resource specified by the filePath
added to the EmbeddedFiles under the PdfPortfolio (root file) or parent PdfPortfolioFolder.
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 EmbeddedFiles.
- System.NotSupportedException
The parent PdfPortfolioFolder is not in the PDF portfolio.
AddEmpty(String)
Add a new PdfFileSpecification with the specified name and an empty EmbeddedFile to EmbeddedFiles under the PdfPortfolio (root file) or parent PdfPortfolioFolder.
Use the OpenWrite(Boolean) method of the EmbeddedFile of a returned PdfFileSpecification to fill the empty EmbeddedFile.
public PdfFileSpecification AddEmpty(string fileSpecificationName)
Public Function AddEmpty(fileSpecificationName As String) As PdfFileSpecification
Parameters
fileSpecificationName
- System.String
The name of a newly added PdfFileSpecification. This value is also used to resolve a key in the EmbeddedFiles of a newly added PdfFileSpecification.
Returns
A newly created PdfFileSpecification with the specified name and an empty EmbeddedFile added to the EmbeddedFiles under the PdfPortfolio (root file) or parent PdfPortfolioFolder.
Exceptions
- System.ArgumentNullException
fileSpecificationName
is null or System.String.Empty.
- System.ArgumentException
A PdfFileSpecification with the same key already exists in the EmbeddedFiles.
- System.NotSupportedException
The parent PdfPortfolioFolder is not in the PDF portfolio.
GetEnumerator()
Returns an enumerator that iterates through the PdfPortfolioFileCollection.
public PdfPortfolioFileCollection.Enumerator GetEnumerator()
Public Function GetEnumerator As PdfPortfolioFileCollection.Enumerator
Returns
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) |