Page.getThumbInfo() returns null

Q: The steps look straight forward, get the document, get the page, get the thumbnail:

PDFDoc doc = mPDFView.getDoc();

Page page = doc.getPage(1);

int[] imageInfo = page.getThumbInfo();

The doc and page object are valid, but getThumbInfo() is returning null.

A: The getThumbInfo() method does not create a thumbnail, it returns the embedded thumbnail associated to the page. Your are getting a null array because probably your document does not have embedded thumbs. If you wish to generate a thumbnail, your best bet would be to use an instance of PDFDraw to rasterize the page at a small resolution.

If you want more information on PDFDraw, you can search our knowledge base: https://groups.google.com/forum/#!searchin/pdfnet-sdk/pdfdraw or just take a look at the sample app (http://www.pdftron.com/pdfnet/samplecode.html#PDFDraw).

These articles describe how to generate / embed thumbs in PDF :

https://groups.google.com/d/msg/pdfnet-sdk/uNeLm3WmLK4/e78Y7K4tEEEJ

https://groups.google.com/d/msg/pdfnet-sdk/PV_M_FvUfQ0/RJKZc9LzU1cJ

To take advantage of thumbnails in PDFViewCtrl (to provide instant low-res image), use PDFViewCtrl.setupThumbnails().

Note also, that you can also call PDFDoc.GenerateThumbs(max_dimension) to embed thumbnails in all pages of the document:

https://www.pdftron.com/pdfnet/docs/PDFNet/html/M_pdftron_PDF_PDFDoc_GenerateThumbnails.htm