getThumbnailsGridElement Method

Summary

Gets a composite raster image of one or more page thumbnails.

Syntax
TypeScript
JavaScript
DocumentImages.prototype.getThumbnailsGridElement = function( 
   firstPageNumber, 
   lastPageNumber, 
   maximumGridWidth, 
   imageLoader 
) 
getThumbnailsGridElement( 
   firstPageNumber: number, 
   lastPageNumber: number, 
   maximumGridWidth: number, 
   imageLoader: ImageLoader 
): JQueryPromise<Element>; 

Parameters

firstPageNumber

1-based number of the first page number in the document.

lastPageNumber

1-based number of the last page number in the document.

maximumGridWidth

The maximum width of the grid in pixels.

imageLoader

An optional ImageLoader instance to use instead of the internally-created one.

Return Value

A Promise object that may resolve successfully to an HTML Element, or fail if the thumbnails grid raster image cannot be returned because it does not exist.

Remarks

To only get the URL instead of loading the image, see GetThumbnailsGridUrl.

Thumbnail grids can be used to obtain the thumbnails of one or more pages in a single call. The result image will contain the images in a grid layout, left to right by row; each image will be of size thumbnailPixelSize. The grid width will be less than or equal to maximumGridWidth in pixels. The number of columns is calculated by dividing maximumGridWidth by the thumbnailPixelSize width. The grid height and number of rows is determined by the columns and total number of images to obtain.

The total number of images to obtain is calculated from firstPageNumber and lastPageNumber. If lastPageNumber is 0 or -1, the last page number in the document will be used; in this case, all pages from firstPageNumber to the end of the document will be returned in the thumbnail grid.

The LEADTOOLS Document Viewer uses GetThumbnailsGridUrl to speed up obtaining the thumbnails of the pages in the document instead of iterating each page and calling GetThumbnailImageUrl.

Note that this method does not update the LEADTOOLS cache.

This method takes an optional imageLoader parameter for additional image load configuration. If an ImageLoader is provided, Run will not be called and it is the responsibility of the application to call it when needed. If an ImageLoader is not supplied, one is created internally and Run is called before this method exits. See Documents Image Loading for more information.

This request can pass arbitrary user data through ServiceUserData.

Refer to Image Loading Using LEADTOOLS Document Library and Document Loading Using LEADTOOLS Document Library for more information.

Example

For an example, see getThumbnailsGridUrl.

Requirements

Target Platforms

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly