2016-12-03 54 views

回答

0

您正在尋找Android的PDFRender類。你會構建類似於下面的東西,然後通過YourImageView.setImageBitmap()method設置爲ImageView

// create a new renderer 
PdfRenderer renderer = new PdfRenderer(getSeekableFileDescriptor()); 

// let us just render all pages 
final int pageCount = renderer.getPageCount(); 
for (int i = 0; i < pageCount; i++) { 
    Page page = renderer.openPage(i); 

    // say we render for showing on the screen 
    page.render(mBitmap, null, null, Page.RENDER_MODE_FOR_DISPLAY); 

    // do stuff with the bitmap 

    // close the page 
    page.close(); 
} 

// close the renderer 
renderer.close(); 
相關問題