'Declaration
Public Overloads Shared Function GetDocumentPreview( _ ByVal FileStream As Stream, _ ByVal FileName As String, _ ByVal ThumbnailWidth As Integer, _ ByVal ThumbnailHeight As Integer, _ ByVal BackColor As Integer, _ ByVal ThumbnailFitToPageSize As Boolean, _ ByRef DocumentFormat As DocumentFormat, _ ByRef ThumbnailID As Integer, _ ByRef PageCount As Integer _ ) As GdPictureStatus
public static GdPictureStatus GetDocumentPreview( Stream FileStream, string FileName, int ThumbnailWidth, int ThumbnailHeight, int BackColor, bool ThumbnailFitToPageSize, ref DocumentFormat DocumentFormat, ref int ThumbnailID, ref int PageCount )
public function GetDocumentPreview( FileStream: Stream; FileName: String; ThumbnailWidth: Integer; ThumbnailHeight: Integer; BackColor: Integer; ThumbnailFitToPageSize: Boolean; var DocumentFormat: DocumentFormat; var ThumbnailID: Integer; var PageCount: Integer ): GdPictureStatus; static;
public static function GetDocumentPreview( FileStream : Stream, FileName : String, ThumbnailWidth : int, ThumbnailHeight : int, BackColor : int, ThumbnailFitToPageSize : boolean, DocumentFormat : DocumentFormat, ThumbnailID : int, PageCount : int ) : GdPictureStatus;
public: static GdPictureStatus GetDocumentPreview( Stream* FileStream, string* FileName, int ThumbnailWidth, int ThumbnailHeight, int BackColor, bool ThumbnailFitToPageSize, ref DocumentFormat DocumentFormat, ref int ThumbnailID, ref int PageCount )
public: static GdPictureStatus GetDocumentPreview( Stream^ FileStream, String^ FileName, int ThumbnailWidth, int ThumbnailHeight, int BackColor, bool ThumbnailFitToPageSize, DocumentFormat% DocumentFormat, int% ThumbnailID, int% PageCount )
Parameters
- FileStream
- A System.IO.Stream object. This stream object must be initialized before it can be sent into this method and it should remain open for subsequent use. At the same, the provided stream object must support seeking, otherwise the method will fail.
- FileName
- The name of the original file. It can be an empty string. Providing this parameter can help the format detection algorithm to distinguish format using the same signature pattern.
- ThumbnailWidth
- The required width of the generated thumbnail of the first page, in pixels.
- ThumbnailHeight
- The required height of the generated thumbnail of the first page, in pixels.
- BackColor
- The required background color of the generated thumbnail, in ARGB format.
- ThumbnailFitToPageSize
- Specifies if the size of the produced thumbnail is automatically adjusted to don't have any margin.
- DocumentFormat
- Output parameter. A member of the DocumentFormat enumeration. The format of the specified document.
- ThumbnailID
- Output parameter. The unique image identifier of a newly generated thumbnail image of the first page of the specified document. Be aware that you need to subsequently release this image from memory using the GdPictureDocumentUtilities.DisposeImage method after you have used it.
- PageCount
- Output parameter. The total number of pages of the specified document.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.