Page.getThumbInfo() returns null

64 views
Skip to first unread message

Anderson Konzen

unread,
Aug 19, 2013, 5:35:26 PM8/19/13
to pdfne...@googlegroups.com
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).

Support

unread,
Aug 19, 2013, 6:33:06 PM8/19/13
to pdfne...@googlegroups.com
 
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().

Aaron

unread,
Jan 7, 2015, 3:28:58 PM1/7/15
to pdfne...@googlegroups.com
Note also, that you can also call PDFDoc.GenerateThumbs(max_dimension) to embed thumbnails in all pages of the document:
Reply all
Reply to author
Forward
0 new messages