草庐IT

安卓pdf阅读器

我想使用Androidpdf库http://andpdf.sourceforge.net/,但我有同样的错误。日志:ST='file'nofileselected'notfound'ST='readingpage1,zoom:1.0'我的类(class):publicclassReaderextendsPdfViewerActivity{publicintgetPreviousPageImageResource(){returnR.drawable.left_arrow;}publicintgetNextPageImageResource(){returnR.drawable.righ

android - mupdf:如何使用 openBuffer 方法打开 pdf 文件?

不幸的是,我还没有找到关于这一点的任何文档,所以也许我做错了什么。我在android上使用mupdf示例,我以这种方式稍微修改了MuPDFActivity的源代码:publicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);mAlertBuilder=newAlertDialog.Builder(this);if(core==null){core=(MuPDFCore)getLastNonConfigurationInstance();if(savedInstanceState!=nul

android - PrintedPdfDocument 总是导致损坏的 PDF

我正在尝试根据用户在我的Android应用程序中显示的表单创建PDF文档。我使用以下代码创建PDF文件,然后将其附加到电子邮件中:publicstaticFilegenerate(ViewsalesFragmentTableLayout,Contextcontext)throwsKingdomSpasException{BuilderprintAttrsBuilder=newBuilder();printAttrsBuilder.setMediaSize(PrintAttributes.MediaSize.ISO_A4);printAttrsBuilder.setMinMargins(

android - 如何允许用户仅从 android 的内部和外部存储器中选择 pdf 文件

因为我可以打开“下载”文件夹,但PDF看起来已被禁用,所以我无法选择PDF文件。还有其他方法可以实现吗?点击按钮的代码caseR.id.pdf_Upload:Intentintent=newIntent();intent.setType("pdf/*");intent.setAction(Intent.ACTION_GET_CONTENT);startActivityForResult(Intent.createChooser(intent,"SelectPdf"),REQUESTCODE_PICK_Pdf);break;protectedvoidonActivityResult(in

android - PDF 打印 View 问题

我试过两种方式,1)我正在创建一个WebView并加载我的pdf文档,我的应用程序几乎完成了打印过程的一部分。但是我面临着打印问题。它不是完整的A4纸View。任何人都可以帮忙,我使用了以下代码,publicvoidcreateWebPagePrint(WebViewwebView){PrintManagerprintManager=(PrintManager)getSystemService(Context.PRINT_SERVICE);PrintDocumentAdapterprintAdapter=null;if(Build.VERSION.SDK_INT>=Build.VERS

Android 如何将 PDF 文件作为字节数组传递给 Intent

我有一项Activity允许用户使用默认的pdf/ebook查看器打开加密的pdf文件。加密pdf文件的解密结果是一个字节数组。我想将该字节数组传递给以PDF形式打开该字节数组的Intent。Intent实例化是这样的:PackageManagerpm=PackageManager;IntentintentPdf=pm.GetLaunchIntentForPackage("com.adobe.android");这可能吗?pdf阅读器(Adobe/任何其他)能否从字节数组中理解它是PDF文件?我尝试使用Bundle.PutByteArray和Intent.putExtra,但它不起作用

android - XFinium PDF 图书馆移动 : How to get height of a wrapped text

我们正在使用XFiniumPDF库从移动设备生成PDF文档。我们正在使用如下代码示例编写环绕文本:PdfStringAppearanceOptionssao=newPdfStringAppearanceOptions();sao.Brush=brush;sao.Font=helvetica;//Heightisnotset,texthasnoverticallimit.PdfStringLayoutOptionsslo=newPdfStringLayoutOptions();slo.HorizontalAlign=PdfStringHorizontalAlign.Justified;s

android - 使用 Polaris office 5 从外部打开 PDF 返回 "This document cannot be opened"

过去几个小时我们一直在努力解决这个问题,最后决定我们应该恢复到StackOverflow。这里是——我们有一个应用程序,它从服务器下载一个PDF文件到应用程序的缓存目录,然后使用数据包管理器打开它。当然,它会通过grantUriPermission()授予对所有可用包的读取(和写入)权限。虽然它在大多数设备上运行良好,但今天我们遇到了一台安装了POLARISOffice5作为默认PDF查看器的设备。每当我们打开文件时,Polaris只会显示一条消息“无法打开此文档”。我应该说,当尝试通过AcrobatReader打开文件时,效果很好。此外,当我们将文件从缓存目录复制到外部目录(使用An

android - 如何在Android中获取pdf文件的页数?

你能帮我找出Android上的pdf文档的页数吗,它至少支持api版本16。我正在提取文档信息,但看不到获取总页数的解决方案.到目前为止,这是我所做的:privatevoidextractDocumentDataFromUri(Uriuri){String[]dataFileds=newString[]{MediaStore.MediaColumns.DATA,OpenableColumns.DISPLAY_NAME,OpenableColumns.SIZE};Cursorcursor=context.getContentResolver().query(uri,dataFileds,

android - 将android布局转换为PDF文件

如何将android布局转换为PDF文件。可能吗?。如果可能的话,如何继续将android布局转换为PDF。欢迎提出建议。提前致谢。 最佳答案 我试过很多方法。终于得到答案使用这个库https://mvnrepository.com/artifact/com.itextpdf/itextpdf/5.0.6布局到图像并将其放入pdfimportcom.itextpdf.text.Document;importcom.itextpdf.text.Image;importcom.itextpdf.text.pdf.PdfWriter;St