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

    Show / Hide Table of Contents

    PdfEmbeddedFileSpecificationTree Class

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

    Represents a name tree mapping name PdfStrings to PdfFileSpecifications for PdfEmbeddedFiles (see 7.11.4, "Embedded File Streams").

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

    Methods

    Add(String)

    Adds a new PdfFileSpecification with the EmbeddedFile copied from the resource specified by the filePath.

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

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

    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

    Embedded Files example
    Embedded Files example
    Embedded Files example

    See Also

    PDF Specification ISO 32000-1:2008, section '7.7.4 Name Dictionary'
    PDF Specification ISO 32000-1:2008, section '7.11.4 Embedded File Streams'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.