资源说明:将pdf文件转换成图片并显示在界面,
先要引用AndroidPDFViewerLibrary-master
ByteBuffer buffer = ByteBuffer.NEW(bytes);
String data = Base64.encodeToString(bytes, Base64.DEFAULT);
PDFFile pdf_file = new PDFFile(buffer);
int numPages = pdf_file.getNumPages();
Log.v("tag","numPages:"+numPages);
PDFPage page = pdf_file.getPage(0,true);
float scale=2f;
Bitmap image = page.getImage((int)(page.getWidth() * scale), (int)(page.getHeight() * scale), null, true, true);
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。