【文件属性】:
文件名称:android pdf转bitmap
文件大小:20.29MB
文件格式:RAR
更新时间:2021-08-21 09:46:39
pdf android bitmap
将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);
【文件预览】:
AndroidPDFViewerLibrary-master.zip
test2.rar