ImageGear v26.5 - Updated
ImageGear.Core Assembly / ImageGear.Formats Namespace / ImGearFileFormats Class / LoadDocument Method / LoadDocument(Stream,Int32,Int32,ImGearLoadOptions) Method
The data stream containing an image.
The number of the first page to load.
Total number of pages to load.
The loading options.




In This Topic
    LoadDocument(Stream,Int32,Int32,ImGearLoadOptions) Method
    In This Topic
    Loads a range of pages from an image.
    Syntax
    'Declaration
     
    Public Overloads Shared Function LoadDocument( _
       ByVal stream As Stream, _
       ByVal startPageNumber As Integer, _
       ByVal count As Integer, _
       ByVal options As ImGearLoadOptions _
    ) As ImGearDocument
    'Usage
     
    Dim stream As Stream
    Dim startPageNumber As Integer
    Dim count As Integer
    Dim options As ImGearLoadOptions
    Dim value As ImGearDocument
     
    value = ImGearFileFormats.LoadDocument(stream, startPageNumber, count, options)
    public static ImGearDocument LoadDocument( 
       Stream stream,
       int startPageNumber,
       int count,
       ImGearLoadOptions options
    )
    public: static ImGearDocument* LoadDocument( 
       Stream* stream,
       int startPageNumber,
       int count,
       ImGearLoadOptions* options
    ) 
    public:
    static ImGearDocument^ LoadDocument( 
       Stream^ stream,
       int startPageNumber,
       int count,
       ImGearLoadOptions^ options
    ) 

    Parameters

    stream
    The data stream containing an image.
    startPageNumber
    The number of the first page to load.
    count
    Total number of pages to load.
    options
    The loading options.

    Return Value

    A new instance of ImageGear.Core.ImGearDocument class.
    Exceptions
    ExceptionDescription
    Office document is protected by password.
    Remarks
    This method allows you to load several pages in a single call and get access to the document level metadata of an image. It is recommended to use this method when working with PDF format since pages inside a PDF file depend on each other, and thus, loading them at once (as a document) is preferable to loading pages individually. If the format of an image cannot be detected, an exception is thrown.

    This method provides more flexibility for loading images (i.e., the ability to load image thumbnail and specify image format explicitly). If the document size is close to 2GB, an exception of System.OutOfMemoryException will be thrown.

    See Also