I am Working on a project where i need to show pdf files. I have lots of images in pdf file. I am using pdfviewer.jar to work on it. I implemented the code, where my pdf is displayed but, the images are not displayed. The error is:
09-05 02:09:31.730: W/System.err(1050): com.sun.pdfview.PDFParseException: could not decode image of compressed size 65985
09-05 02:09:31.730: W/System.err(1050): at com.sun.pdfview.decode.DCTDecode.decode(DCTDecode.java:78)
09-05 02:09:31.730: W/System.err(1050): at com.sun.pdfview.decode.PDFDecoder.decodeStream(PDFDecoder.java:102)
09-05 02:09:31.730: W/System.err(1050): at com.sun.pdfview.PDFObject.decodeStream(PDFObject.java:334)
09-05 02:09:31.750: W/System.err(1050): at com.sun.pdfview.PDFObject.getStream(PDFObject.java:266)
09-05 02:09:31.750: W/System.err(1050): at com.sun.pdfview.PDFObject.getStream(PDFObject.java:260)
09-05 02:09:31.770: W/System.err(1050): at com.sun.pdfview.PDFImage.getImage(PDFImage.java:224)
09-05 02:09:31.770: W/System.err(1050): at com.sun.pdfview.PDFRenderer.drawImage(PDFRenderer.java:374)
09-05 02:09:31.770: W/System.err(1050): at com.sun.pdfview.PDFImageCmd.execute(PDFPage.java:654)
09-05 02:09:31.780: W/System.err(1050): at com.sun.pdfview.PDFRenderer.iterate(PDFRenderer.java:674)
09-05 02:09:31.780: W/System.err(1050): at com.sun.pdfview.BaseWatchable.run(BaseWatchable.java:101)
09-05 02:09:31.780: W/System.err(1050): at com.sun.pdfview.BaseWatchable.execute(BaseWatchable.java:263)
09-05 02:09:31.800: W/System.err(1050): at com.sun.pdfview.BaseWatchable.go(BaseWatchable.java:197)
09-05 02:09:31.810: W/System.err(1050): at com.sun.pdfview.PDFPage.getImage(PDFPage.java:237)
09-05 02:09:31.820: W/System.err(1050): at net.sf.andpdf.pdfviewer.PdfViewerActivity.showPage(PdfViewerActivity.java:790)
09-05 02:09:31.820: W/System.err(1050): at net.sf.andpdf.pdfviewer.PdfViewerActivity.access$12(PdfViewerActivity.java:769)
09-05 02:09:31.820: W/System.err(1050): at net.sf.andpdf.pdfviewer.PdfViewerActivity$3.run(PdfViewerActivity.java:259)
09-05 02:09:31.829: W/System.err(1050): at java.lang.Thread.run(Thread.java:841)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): null
09-05 02:09:31.859: E/APV.PDFRenderer(1050): java.lang.NullPointerException
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at android.graphics.Canvas.drawBitmap(Canvas.java:1227)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at com.sun.pdfview.PDFRenderer.drawImage(PDFRenderer.java:386)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at com.sun.pdfview.PDFImageCmd.execute(PDFPage.java:654)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at com.sun.pdfview.PDFRenderer.iterate(PDFRenderer.java:674)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at com.sun.pdfview.BaseWatchable.run(BaseWatchable.java:101)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at com.sun.pdfview.BaseWatchable.execute(BaseWatchable.java:263)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at com.sun.pdfview.BaseWatchable.go(BaseWatchable.java:197)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at com.sun.pdfview.PDFPage.getImage(PDFPage.java:237)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at net.sf.andpdf.pdfviewer.PdfViewerActivity.showPage(PdfViewerActivity.java:790)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at net.sf.andpdf.pdfviewer.PdfViewerActivity.access$12(PdfViewerActivity.java:769)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at net.sf.andpdf.pdfviewer.PdfViewerActivity$3.run(PdfViewerActivity.java:259)
09-05 02:09:31.859: E/APV.PDFRenderer(1050): at java.lang.Thread.run(Thread.java:841)
Thanks in advance.
The problem is with buffer size. Need to take care of the bitmap like making sure that the outofmemoryexception is eliminated.