I want to displaythe thumb images of pdf in my app. I am using this answer. But I don't know how to use it in android as Rectangle2D can't be userd in java. I tried using RectFand modified the code as:
File file = new File(arrayOfResults.get(arg0).filePath);
RandomAccessFile raf = new RandomAccessFile(file, "r");
FileChannel channel = raf.getChannel();
ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY,
0, channel.size());
PDFFile pdffile = new PDFFile(buf);
// draw the first page to an image
PDFPage page = pdffile.getPage(0);
// get the width and height for the doc at the default zoom
RectF rect = new RectF(0, 0, (int) page.getWidth(),
(int) page.getHeight());
But the app crashed with the following error:
java.lang.NoClassDefFoundError: java.awt.geom.Rectangle2D$Double
at com.sun.pdfview.PDFFile.parseNormalisedRectangle(PDFFile.java:1874)
Please help.