Gets an HTML Element representing the raster image for this page.
Color to use to fill the background of the image.
An optional ImageLoader instance to use instead of the internally-created one.
A Promise object that may resolve successfully to an HTML Element. If IsSvgSupported is false, the request and Promise object will fail. If the SVG for this page contains no background images, the request and Promise object will return a 1x1 transparent GIF image.
To only get the URL instead of loading the image, see GetSvgBackImageUrl.
Not all document types support this method; if IsSvgSupported is false, an error will be returned from the service. Otherwise, a new image is created and filled with backColor (if its not a transparent color). Then, the SVG data containing only the image elements is rendered on the surface of this image. The resulting raster image is the same size as the DocumentPage.
If the SVG page has no image elements, a transparent 1x1 GIF image is returned in order to send minimal data while keeping the request a success.
The user can check the
naturalHeight values for the result to verify that this has occurred: each should be
If working with the ImageViewer, the user may wish to check for these values before adding to the BackImage
property, so as to not have a transparent background for no reason. Internal loading through BackImageUrl does this same check.
This method can work in conjunction with GetSvgUrl or GetSvgElement to return the background images for an SVG as a separate raster image while keeping any text or other objects as SVG. This method is used in the LEADTOOLS Document Viewer.
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 Documents Library and Document Loading Using LEADTOOLS Documents Library for more information.