Did you find this guide helpful?
Some test text!
Android / Guides / Create a thumbnail
With PDFViewCtrl
, you can get a thumbnail Bitmap
image for each page in a PDF document.
The following example request thumbnail for page 3:
pdfViewCtrl.addThumbAsyncListener(new PDFViewCtrl.ThumbAsyncListener() {
@Override
public void onThumbReceived(int page, int[] buf, int width, int height) {
try {
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
bitmap.setPixels(buf, 0, width, 0, 0, width, height);
// use the bitmap
} catch (OutOfMemoryError oom) {
// error
}
}
});
// request thumbnail for page 3
pdfViewCtrl.getThumbAsync(3);
where pdfViewCtrl
is an instance of PDFViewCtrl
.
PDFViewCtrl.cancelAllThumbRequests()
.
Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales