getImageResizedElement Method

Summary

Gets the raster image of this page with a specified size. Aspect ratio is preserved.

Syntax
TypeScript
JavaScript
DocumentPage.prototype.getImageResizedElement = function( 
   width, 
   height, 
   imageLoader 
) 
getImageResizedElement( 
   width: number, 
   height: number, 
   imageLoader: ImageLoader 
): JQueryPromise<Element>; 

Parameters

width

Requested width in pixels.

height

Requested height 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 resized raster image cannot be returned because it does not exist for this DocumentPage.

Remarks

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

All document types support this method.

If this document type supports loading raster images at any resolution (the value of DocumentImages.IsResolutionsSupported is true, then this method will return the image using the current page Resolution value.

The LEADTOOLS Document Viewer uses this method to obtain the raster image for the page when the view mode is "Image". The LEADTOOLS Document Converter uses this method to obtain the raster image for the page when converting using OCR or when adding the overlay image of a page if needed.

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.

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