PdfViewWrapper.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:reader 作者:
/**
 * Loads the PDF file at the given path into the pdf.js component within WebView.
 */
public void loadPdfFile(final String fileId, final int initialPage) throws IOException {
    File pdfFile = new File(getContext().getCacheDir(), fileId);

    try (InputStream in = DB.Singleton.get(getContext()).getInputStreamForFile(fileId);
         FileOutputStream out = new FileOutputStream(pdfFile)) {
        ByteStreams.copy(in, out);
    }

    mRenderer = new PdfRenderer(
            ParcelFileDescriptor.open(pdfFile, ParcelFileDescriptor.MODE_READ_ONLY));

    setPage(initialPage);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号