如何在 android 中卷曲 pdf 页面
How to curl pdf pages in android
我搜索了很多但没有得到正确的代码来在我的项目中实现,我想卷曲 PDF 文件的每一页,就像普通的书一样但做不到,在我的代码中当我点击按钮时从 sdCard 加载 PDF 文件。
File file = new File("/sdcard/android.pdf");
if (file.exists()) {
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {
startActivity(intent);
}
catch (ActivityNotFoundException e) {
Toast.makeText(MainActivity.this,
"No Application Available to View PDF",
Toast.LENGTH_SHORT).show();
}
}
curl 抓住了整个网络 page/file。您需要在抓取或使用第 3 方工具或网站后将 PDF 拆分为单独的页面,然后抓取它生成的单个页面
我搜索了很多但没有得到正确的代码来在我的项目中实现,我想卷曲 PDF 文件的每一页,就像普通的书一样但做不到,在我的代码中当我点击按钮时从 sdCard 加载 PDF 文件。
File file = new File("/sdcard/android.pdf");
if (file.exists()) {
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {
startActivity(intent);
}
catch (ActivityNotFoundException e) {
Toast.makeText(MainActivity.this,
"No Application Available to View PDF",
Toast.LENGTH_SHORT).show();
}
}
curl 抓住了整个网络 page/file。您需要在抓取或使用第 3 方工具或网站后将 PDF 拆分为单独的页面,然后抓取它生成的单个页面