Generate PDF page thumbnails using Apryse's Web SDK
Page thumbnails are rendered image representations of the page they are generated from.
The SDK API has the flexibility to alter the resolution or size of the thumbnail output and whether to include annotations or not.
Create a basic page thumbnail
To create a basic PDF page thumbnail where the result is a HTMLCanvasElement or HTMLImageElement.
_loadThumbnailAsync__ is deprecated since version 8.3 and removed since version 10.0. Please use _loadThumbnail_ instead._
WebViewer(...)
.then(instance => {
const { documentViewer } = instance.Core;
documentViewer.addEventListener('documentLoaded', () => {
const doc = documentViewer.getDocument();
const pageNum = 1;
doc.loadThumbnail(pageNum, (thumbnail) => {
// thumbnail is a HTMLCanvasElement or HTMLImageElement
console.log(thumbnail);
});
});
});WebViewer(...)
.then(instance => {
const { docViewer } = instance;
docViewer.on('documentLoaded', () => {
const doc = docViewer.getDocument();
const pageNum = 1;
doc.loadThumbnailAsync(pageNum, (thumbnail) => {
// thumbnail is a HTMLCanvasElement or HTMLImageElement
console.log(thumbnail);
});
});
});Create a High resolution page image (png or jpg) with annotations
To create a high resolution page thumnbails and optionally with annotations where the result is a HTMLCanvasElement or HTMLImageElement.
_loadCanvasAsync__ is deprecated since version 8.3 and removed since version 10.0. Please use _loadCanvas_ instead._
Last updated
Was this helpful?