GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfPortfolioFileCollection Class

    Namespace:
    GemBox.Pdf.Portfolios
    Assembly:
    GemBox.Pdf.dll

    Represents a collection of a PdfFileSpecifications contained in the Files (root files) or some Files.

    • C#
    • VB.NET
    public sealed class PdfPortfolioFileCollection : PdfCollection<PdfFileSpecification>, IList, ICollection, IList<PdfFileSpecification>, ICollection<PdfFileSpecification>, IReadOnlyList<PdfFileSpecification>, IReadOnlyCollection<PdfFileSpecification>, IEnumerable<PdfFileSpecification>, IEnumerable
    Public NotInheritable Class PdfPortfolioFileCollection
        Inherits PdfCollection(Of PdfFileSpecification)
        Implements IList, ICollection, IList(Of PdfFileSpecification), ICollection(Of PdfFileSpecification), IReadOnlyList(Of PdfFileSpecification), IReadOnlyCollection(Of PdfFileSpecification), IEnumerable(Of PdfFileSpecification), IEnumerable
    Inheritance:
    System.Object
    PdfObject
    PdfCollection
    PdfCollection<PdfFileSpecification>
    PdfPortfolioFileCollection
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<PdfFileSpecification>
    System.Collections.Generic.ICollection<PdfFileSpecification>
    System.Collections.Generic.IReadOnlyList<PdfFileSpecification>
    System.Collections.Generic.IReadOnlyCollection<PdfFileSpecification>
    System.Collections.Generic.IEnumerable<PdfFileSpecification>
    System.Collections.IEnumerable
    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.

    • C#
    • VB.NET
    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
    PdfFileSpecification

    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.

    • C#
    • VB.NET
    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
    PdfFileSpecification

    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.

    • C#
    • VB.NET
    public PdfPortfolioFileCollection.Enumerator GetEnumerator()
    Public Function GetEnumerator As PdfPortfolioFileCollection.Enumerator
    Returns
    PdfPortfolioFileCollection.Enumerator

    A PdfPortfolioFileCollection.Enumerator for the PdfPortfolioFileCollection.

    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)

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IReadOnlyList<T>
    System.Collections.Generic.IReadOnlyCollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    Extension Methods

    PdfObjectExtensions.GetDictionary(PdfObject)
    PdfObjectExtensions.GetOrAddDictionary(PdfObject)
    PdfObjectExtensions.GetArray(PdfObject)
    PdfObjectExtensions.GetArray(PdfCollection)
    PdfObjectExtensions.GetOrAddArray(PdfCollection)

    Examples

    Portfolios example
    Portfolios example
    Portfolios example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.