Questions tagged [pdfdocument]

40 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
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,758
  • 1
  • 12
  • 33
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,181
  • 6
  • 31
  • 58
1
vote
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
  • 949
  • 11
  • 20
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
  • 8
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: …
marina
  • 767
  • 2
  • 7
  • 22
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
  • 538
  • 3
  • 19
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…
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,079
  • 4
  • 21
  • 50
1
vote
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
  • 538
  • 3
  • 19
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
  • 85
  • 7
0
votes
0 answers

Added annotation on PDFPage , still editable when export to Macboook

Me added Pdf annotation using below code textAnnotation = PDFAnnotation(bounds: pageBounds!, forType: .ink, withProperties: nil) pdfView.currentPage?.addAnnotation(textAnnotation!) its working fine, added annotation visible in…
Jagveer Singh
  • 2,352
  • 14
  • 32
0
votes
0 answers

saving a large size PDF Document to a memory stream using a PdfDocumentProcessor

I have tried a code for saving large-sized PDF documents on a memory stream using a PdfDocumentProcessor from devExpress. But when the file size is too large it gives an error like System.OutOfMemoryException. The sample code snippet is shown below.…
John_sl
  • 29
  • 3
0
votes
1 answer

Android - Append additional pdf page to PrintedPdfDocument

in my App I print some parts to a pdf for the user. I do this by using a PrintedPdfDocument. The code looks in short like this: // create a new document val printAttributes = PrintAttributes.Builder() .setMediaSize(mediaSize) …
Tobias Reich
  • 4,414
  • 2
  • 42
  • 77
1
2 3