Questions tagged [pdfdocument]
53 questions
4
votes
0 answers
Testing PdfDocument with RobolectricTestRunner/AndroidJUnit4: document is closed
I am trying to test with Robolectric or AndroidJUnit4 some pdf generation in my android application (using android.graphics.pdf.PdfDocument).
@Test
fun testPdfDocument() {
val doc = PdfDocument()
val builder =…

XAM
- 109
- 1
- 4
2
votes
0 answers
How to add signature to PDF using PDFKit and sticker view?
I am trying to add signature to PDF using PDFKit.
What I have tried:
add annotation as given by PDFKit framework.
give annotation type to signature
save annotation to PDFPage
This is working fine
I have used extension to drag signature image to…

KrishnDip
- 81
- 10
2
votes
1 answer
I need to build pdf viewer but with 2 urls to pdfs file
I try to combine two pdf urls file to one PDFView.
import Foundation
import PDFKit
protocol PdfViewDelegate: class {
func heightDidReccived(height:CGFloat)
}
class PdfView: YITStoryboardCustomXibView {
weak var delegate:…

Roei Nadam
- 1,780
- 1
- 15
- 33
2
votes
0 answers
Android PdfDocument is not printing whole content from recyclerView
I am trying to create PDF file using android API PdfDocument.
If the contents are less (within visible view of the screen) - my code works fine.
If recyclerView contains more items (more than screen height) - all content do not get printed in…

Rajeev Jayaswal
- 1,423
- 1
- 20
- 22
2
votes
0 answers
Courier New font is blurry/sponge when printing to dotmatrix printer
When printing to dotmatrix printer, I noticed the texts in "Courier New" font are blurry/sponge when using GrapeCity's Document PDF.
To make sure it's not a printer driver issues, I used MS Word & set that text to "Courier New" with same font size…

fletchsod
- 3,560
- 7
- 39
- 65
2
votes
1 answer
Add Empty/Blank Page to PdfDocument java
It is there any way to add a Blank Page to an existing PdfDocument ? I've created a method like this:
public void addEmptyPage(PdfDocument pdfDocument){
pdfDocument.addNewPage();
pdfDocument.close();
}
However , when I use it with a…

Nexussim Lements
- 535
- 1
- 15
- 47
1
vote
0 answers
Create PDF from view layout using PDFDocument android
I am trying to create PDF file of A4 paper size from an android app from xml view using native PDFDocument library. I want to generate a pdf with single page that displays some information. I am facing a problem wrapping the view contents in the…

manz mahrzn
- 11
- 3
1
vote
1 answer
I have a problem with numbers when writing them, their place changes from the text when using the Arabic language
I have a problem with numbers when writing them, their place changes from the text when using the Arabic language
Note that in the case of writing in English, no error occurs
TextPaint mTextPaint = new TextPaint();
StaticLayout mTextLayout = new…
1
vote
0 answers
Huge PDF file size with PdfDocument on older Android
I'm developing an Android app which generates PDF files. I'm using the Android PdfDocument api to do this. It works nice but I noticed that on older versions of Android (I tested 4.4 and 5.0) the size of the generated PDF is huge (about 80 MB for…

Piotr
- 71
- 12
1
vote
1 answer
Knitting R-Markdown document causes "! Undefined control sequence." error
I'm creating an R Markdown document and keep getting errors when trying to print out a mathematical formula. I think the errors are somewhere in the header, but I can't quite pin it down. Here's a watered-down version of the document:
---
output:
…

pikovayadama
- 808
- 2
- 8
- 26
1
vote
0 answers
com.itextpdf.kernel.PdfException: Document was closed. It is impossible to execute action
I have the following method that shrink the page to 50% :
private void shrinkDocuments(List documentsToBeMerged){
for (PdfDocument pdfDoc : documentsToBeMerged) {
for (int p = 1; p <= pdfDoc.getNumberOfPages(); p++) {
…

Nexussim Lements
- 535
- 1
- 15
- 47
1
vote
0 answers
PDFKit - PDFDocument object increase file size while saving
I am working on a PDF app which imports pdf document from Mail app. After importing the file (2 MB) in the app and opening it using PDFKit PDFDocument class the file size increases to 35 MB. I checked it by using PDFDocument.dataRepresentation()…

Shival
- 11
- 2
1
vote
0 answers
PDFDocument - multiple pages
I am using the PDFDocument class to convert RelativeLayout which gets populated at runtime to PDF. I know how to do this for 1 page of PDF, however, if at runtime, the RelativeLayout has no of pages > 1, then I do not know how to do this. I think I…

TheGeoExpert TGE
- 43
- 8
1
vote
0 answers
How to draw a compressed image on a Canvas without decoding it?
I have a JPEG image on the device which I want to draw on a canvas to compose a simple PDF (just the image) using (PdfDocument).
The only way that the Canvas api seems to offer to draw an image, is to give it a Bitmap, to decode my JPEG into a…

John Sardinha
- 3,566
- 6
- 25
- 55
1
vote
2 answers
Import a pdf document from assets into a PdfDocument object
I have managed to create my own pdf documents with the help of PdfDocument Class.
But what if I already have a pdf in my (let's say) assets folder and I want to e.g. draw something on it. Is it possible?
I have my
PdfDocument document;
But how can…

monkeydkon
- 95
- 9