【发布时间】:2013-01-12 14:54:27
【问题描述】:
我的要求是,我需要为我的应用以 pdf 格式显示内容。我正在通过 HTTP 调用获取文件的 InputStream。如何将此 InputStream 转换为 PDF 视图而不存储在 SD 卡中?
我可以使用下面的代码:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(File Path)), "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
但是有没有其他方式可以在 PDF 中显示?
【问题讨论】:
-
你可以试试 InputStream object = this.getResources() .openRawResource(R.raw.fileName);
-
上一条评论与问题无关。
标签: android