Questions tagged [android-pdf-api]

Android APIs for manipulation of PDF content.

Android APIs for manipulation of PDF content.

Reference: https://developer.android.com/reference/android/graphics/pdf/package-summary.html

50 questions
228
votes
11 answers

How to render a PDF file in Android

Android does not have PDF support in its libraries. Is there any way to render PDF files in the Android applications?
alexleutgoeb
  • 3,123
  • 3
  • 20
  • 31
21
votes
6 answers

How to convert Image to PDF?

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…
Anish Kumar
  • 478
  • 4
  • 12
  • 27
19
votes
4 answers

Creating a pdf file in android programmatically and writing in it

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…
Husayn Hakeem
  • 4,184
  • 1
  • 16
  • 31
13
votes
4 answers

PDF file when opening in Android Nougat is showing blank screen

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 …
Sabya Sachi
  • 145
  • 2
  • 10
9
votes
1 answer

PDF opens and closes immediately

In my application I am downloading pdf to Download folder and I am trying to open using below code. String FileName="CardsDecks"; File imagePath = new File(this.getFilesDir(), "Download"); File newFile = new File(imagePath, FileName+ ".pdf"); Uri…
Ajinkya kadam
  • 542
  • 1
  • 6
  • 16
5
votes
3 answers

What is the best strategy for creating, displaying and printing pdf documents in android

I plan to use the built-in android pdf library. In my app I need to display a pdf report that may consist of several pages. Users should be able to print those pages. Printing with the PrintDocumentAdapter seems pretty straight forward, but what's…
bmurmistro
  • 1,070
  • 1
  • 16
  • 35
4
votes
1 answer

PDF page navigation issue

As per the SO recommendations, I am using following library to render PDF file. https://github.com/barteksc/AndroidPdfViewer This pdf contains link to redirect to pages. First page is like index. It has list of link to navigate to a particular page…
Rohan Patel
  • 1,758
  • 2
  • 21
  • 38
3
votes
0 answers

Using AnimationManager from Android-pdfview

I am using Android-pdfview library to display pdfs within my application. pdfView.fromFile(new File("/path/to/file")).defaultPage(1).enableSwipe(true).onPageChange(this).load(); How to use AnimationManager from Android-pdfview library ? For…
Khaled H
  • 150
  • 7
3
votes
1 answer

Android PdfDocument multipage cause Fatal signal 11 (SIGSEGV)

I am trying to create a multipage PDF file on Android, using PDFDocument. After creating a new page (method newPDFPage()) the next following line, for example canvas.drawLine(start, position, finish, position, paint); causes the app to crash with no…
Andrej Hafner
  • 99
  • 1
  • 8
3
votes
1 answer

How to view pdf in android browser?

friends, any one guide me how can i view pdf file in android browser? or any other useful way? any help would be appreciated.
UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278
2
votes
0 answers

Read PDF File in Assets folder through PdfRenderer without creating tempfile

I have a pdf file in Assets folder and would like to open it up. I need to create a File as below in order to set as a ParcelFileDescriptor to pass to the PdfRenderer. private val pdfRenderer by lazy { val file = File(cacheDir,…
Elye
  • 53,639
  • 54
  • 212
  • 474
2
votes
2 answers

get number of pages from PDF in android code

I need a clear solution of how to get the number of pages from a PDF file in android. Assuming the person has selected the file then on the onActivityResult(), I want to know how many pages the PDF file is. I would love a solution that will work for…
2
votes
1 answer

Convert HTML String to PDF with native PrintedPdfDocument

How can I convert HTML string (created on the fly) to PDF only using native PrintedPdfDocument (API 19 or higher)? I look for the solution in which I do not need to add any external libraries.
Annabelle
  • 734
  • 9
  • 23
2
votes
1 answer

Emailing PDFDocument

I'm trying to attach a PDF, that is created from a Scroll view, to an email. But the email is sent with nothing attached. There are no error messages displayed. public void emailPDF(View view){ PdfDocument document = getPDF(); …
Ammar Samater
  • 529
  • 2
  • 7
  • 24
2
votes
1 answer

How to save a PdfDocument object in to a file in android?

In my app I have created a PDF document on button click event.And I have used Print Framework to print that document.All these are working fine.What i need is ,i want to save that pdf document to a folder in my phone storage.How to do this,I dont'…
1
2 3 4