PdfExternalObject Class
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.
public abstract class PdfExternalObject : PdfContentResourcePublic MustInherit Class PdfExternalObject
Inherits PdfContentResource- Inheritance:
- System.ObjectPdfExternalObject
- Derived
Properties
AssociatedFiles
(Optional; PDF 2.0) An array of one or more PdfFileSpecifications which denote the associated files for this PdfImage or PdfForm.
public PdfAssociatedFileCollection AssociatedFiles { get; }Public ReadOnly Property AssociatedFiles As PdfAssociatedFileCollectionProperty Value
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.
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 PdfExternalObjectParameters
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
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.
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 PdfExternalObjectParameters
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
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.
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.
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) |