getImageUrl Method


Gets a URL to the raster image for this page.


JavaScript Syntax
DocumentPage.prototype.getImageUrl = function() 
TypeScript Syntax
getImageUrl(): string; 

Return Value

A string representing the URL to the raster image for this page.


For more information on this method or to load the image through the Documents Library, see GetThumbnailImageElement.

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


This example shows will load a PDF document and then load a page into a HTML Image element.

Start with the example in Document and replace the example function call to the function below.

JavaScript Example
function getImageUrlExample() { 
   // Load a new document 
   var url = ""; 
   console.log("Loading document ..."); 
   lt.Documents.DocumentFactory.loadFromUri(url, null) 
       .done(function (doc) { 
          // Just get the URL, to show it can be loaded anywhere 
          var pageNumber = 1; 
          var docPage = doc.pages.item(pageNumber - 1); 
          var pageImageUrl = docPage.getImageUrl(); 
          // Instead of loading through the Documents Library, use an img 
          var img = document.createElement("img"); 
          img.onload = function () { 
          img.onerror = function () { 
          console.log("Loading: " + pageImageUrl); 
          img.src = pageImageUrl; 
       .fail(function (jqXHR, statusText, errorThrown) { 
          showServiceError(jqXHR, statusText, errorThrown); 


Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Documents Assembly