android-pdf-api

Android Oreo 8.0 Native C++ crash , but works fine for Android 7

牧云@^-^@ 提交于 2019-12-11 17:17:54
问题 I am working on an app (pdf viewer) using muPdf library , it's working fine for Android 7 (pdf pages and previews are shown without problems) , but it keeps crashing when i test it on emulator or real device with Android 8. 2019-01-22 09:57:58.178 13878-13980/com.niveales.wind A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0xa5353a50 in tid 13980 (AsyncTask #5), pid 13878 (m.niveales.wind) 2019-01-22 09:57:58.418 13983-13983/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** **

PDF file when opening in Android Nougat is showing blank screen

北慕城南 提交于 2019-12-09 10:06:57
问题 I am creating a PDF file and saving it in local storage. When trying to open it, it is working perfect in all devices except in Android N. I am able to open PDF file in Android N using FileProvider, but it is displaying as blank. This is my URI content://com.products.provider/external_storage_root/Android/data/com.products/in_17052017_170502_1_1001.pdf This is my code Uri path; File pdfFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + "Android" + "/" + "data"

PDF file when opening in Android Nougat is showing blank screen

廉价感情. 提交于 2019-12-03 12:12:27
I am creating a PDF file and saving it in local storage. When trying to open it, it is working perfect in all devices except in Android N. I am able to open PDF file in Android N using FileProvider, but it is displaying as blank. This is my URI content://com.products.provider/external_storage_root/Android/data/com.products/in_17052017_170502_1_1001.pdf This is my code Uri path; File pdfFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + "Android" + "/" + "data" + "/" + "com.products" + "/" + file); if (Build.VERSION.SDK_INT >= 24) { path = FileProvider

How to convert Image to PDF?

吃可爱长大的小学妹 提交于 2019-11-28 06:03:46
I am developing an application where I need to convert an Image to PDF. I tried something, but the issue is, Image size in that PDF is very very small. I need solution to fix this. Also I am looking for converting multiple Images into single PDF document. I will post the code which I tried. public void convertPDF(byte[] path) { String FILE = "mnt/sdcard/FirstPdf.pdf"; Document document=new Document(); try { PdfWriter.getInstance(document, new FileOutputStream(FILE)); document.open(); try { image=Image.getInstance(path); document.add(new Paragraph("My Heading")); document.add(image); document

Creating a pdf file in android programmatically and writing in it

好久不见. 提交于 2019-11-27 03:36:34
I'm trying to create a pdf file inside my app, save it on the external storage the open it. Saving a file isn't an issue for me, nor is opening one, my issue is with creating one and writing in it. So after some research online I found the following way of doing it: File file = new File(directoryName, fileName); // Creating output stream to write in the newly created file FileOutputStream fOut = null; try { fOut = new FileOutputStream(file); } catch (FileNotFoundException e) { e.printStackTrace(); } // Creating a new document Document document = new Document(PageSize.A4, 50, 50, 50, 50); try {

How to convert Image to PDF?

笑着哭i 提交于 2019-11-26 22:48:57
问题 I am developing an application where I need to convert an Image to PDF. I tried something, but the issue is, Image size in that PDF is very very small. I need solution to fix this. Also I am looking for converting multiple Images into single PDF document. I will post the code which I tried. public void convertPDF(byte[] path) { String FILE = "mnt/sdcard/FirstPdf.pdf"; Document document=new Document(); try { PdfWriter.getInstance(document, new FileOutputStream(FILE)); document.open(); try {

Creating a pdf file in android programmatically and writing in it

有些话、适合烂在心里 提交于 2019-11-26 10:29:43
问题 I\'m trying to create a pdf file inside my app, save it on the external storage the open it. Saving a file isn\'t an issue for me, nor is opening one, my issue is with creating one and writing in it. So after some research online I found the following way of doing it: File file = new File(directoryName, fileName); // Creating output stream to write in the newly created file FileOutputStream fOut = null; try { fOut = new FileOutputStream(file); } catch (FileNotFoundException e) { e

How to render a PDF file in Android

扶醉桌前 提交于 2019-11-25 22:58:28
问题 Android does not have PDF support in its libraries. Is there any way to render PDF files in the Android applications? 回答1: Since API Level 21 (Lollipop) Android provides a PdfRenderer class: // 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