Gets a URL to the raster image for this page.
DocumentPage.prototype.getImageUrl = function()
getImageUrl(): string;
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.
function getImageUrlExample() {
// Load a new document
var url = "https://demo.leadtools.com/images/pdf/leadtools.pdf";
console.log("Loading document ...");
lt.Documents.DocumentFactory.loadFromUri(url, null)
.done(function (doc) {
console.log("Done.");
// 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 () {
console.log("Loaded!");
document.body.appendChild(img);
};
img.onerror = function () {
console.log("Failed.");
};
console.log("Loading: " + pageImageUrl);
img.src = pageImageUrl;
})
.fail(function (jqXHR, statusText, errorThrown) {
showServiceError(jqXHR, statusText, errorThrown);
});
}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.