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

    Show / Hide Table of Contents

    PdfExternalObject Class

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

    An external object (commonly called an XObject) is a graphics object whose contents are defined by a self-contained stream, separate from the content stream in which it is used. There are three types of external objects:

    • An image XObject (8.9.5, "Image Dictionaries") represents a sampled visual image such as a photograph.
    • A form XObject (8.10, "Form XObjects") is a self-contained description of an arbitrary sequence of graphics objects.
    • A PostScript XObject (8.8.2, "PostScript XObjects") contains a fragment of code expressed in the PostScript page description language. PostScript XObjects should not be used.
    • C#
    • VB.NET
    public abstract class PdfExternalObject : PdfContentResource
    Public MustInherit Class PdfExternalObject
        Inherits PdfContentResource
    Inheritance:
    System.Object
    PdfObject
    PdfContentResource
    PdfExternalObject
    Derived
    PdfForm
    PdfImage

    Properties

    AssociatedFiles

    (Optional; PDF 2.0) An array of one or more PdfFileSpecifications which denote the associated files for this PdfImage or PdfForm.

    • C#
    • VB.NET
    public PdfAssociatedFileCollection AssociatedFiles { get; }
    Public ReadOnly Property AssociatedFiles As PdfAssociatedFileCollection
    Property Value
    PdfAssociatedFileCollection

    An array of one or more PdfFileSpecifications which denote the associated files for this PdfImage or PdfForm.

    Methods

    Load(PdfDocument, Stream, LoadOptions)

    Loads a PdfExternalObject from the specified stream and with the specified options.

    • C#
    • VB.NET
    public static PdfExternalObject Load(PdfDocument document, Stream stream, LoadOptions options = null)
    Public Shared Function Load(document As PdfDocument, stream As Stream, options As LoadOptions = Nothing) As PdfExternalObject
    Parameters
    document
    PdfDocument

    The PdfDocument associated with the loaded PdfExternalObject.

    stream
    System.IO.Stream

    The stream from which to load a PdfExternalObject.

    options
    LoadOptions

    The options used for loading a PdfExternalObject from the specified stream.

    Returns
    PdfExternalObject

    A loaded PdfExternalObject or null if the frame specified in the FrameIndex or page specified in the PageNumber of the options does not exist in the file.

    Exceptions
    System.ArgumentNullException

    document is null or stream is null.

    Load(PdfDocument, String, LoadOptions)

    Loads a PdfExternalObject from a file with the specified path and with the specified options.

    • C#
    • VB.NET
    public static PdfExternalObject Load(PdfDocument document, string path, LoadOptions options = null)
    Public Shared Function Load(document As PdfDocument, path As String, options As LoadOptions = Nothing) As PdfExternalObject
    Parameters
    document
    PdfDocument

    The PdfDocument associated with the loaded PdfExternalObject.

    path
    System.String

    The path to a file from which to load a PdfExternalObject.

    options
    LoadOptions

    The options used for loading a PdfExternalObject from a file.

    Returns
    PdfExternalObject

    A loaded PdfExternalObject or null if the frame specified in the FrameIndex or page specified in the PageNumber of the options does not exist in the file.

    Exceptions
    System.ArgumentNullException

    document is null or path is null.

    Save(Stream, SaveOptions)

    Saves the external object to the specified stream and with the specified options.

    • C#
    • VB.NET
    public void Save(Stream stream, SaveOptions options = null)
    Public Sub Save(stream As Stream, options As SaveOptions = Nothing)
    Parameters
    stream
    System.IO.Stream

    The stream to save to.

    options
    SaveOptions

    The options used for saving the external object.

    Exceptions
    System.ArgumentNullException

    stream is null.

    Save(String, SaveOptions)

    Saves the external object to a file with the specified path and with the specified options.

    • C#
    • VB.NET
    public void Save(string path, SaveOptions options = null)
    Public Sub Save(path As String, options As SaveOptions = Nothing)
    Parameters
    path
    System.String

    The path to the file to save to.

    options
    SaveOptions

    The options used for saving the external object.

    Exceptions
    System.ArgumentNullException

    path is null.

    Inherited Properties

    Document

    Gets the PdfDocument associated with this PdfContentResource or null if no PdfDocument is associated with this PdfContentResource.

    (Inherited from PdfContentResource)

    Metadata

    (Optional; PDF 1.4) A metadata stream containing metadata for the component.

    (Inherited from PdfObject)

    Extension Methods

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

    Examples

    Associated Files example

    See Also

    PDF Specification ISO 32000-1:2008, section '8.8 External Objects'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.