pdfrenderer

Android Studio - PDFRendererBasic - Unable to replace sample.pdf?

混江龙づ霸主 提交于 2019-12-10 05:35:09
问题 Everytime I edit the PDFRendererBasicFragment java code mFileDescriptor = context.getAssets().openFd("sample.pdf").getParcelFileDescriptor(); to a different pdf placed in the assets folder, the application crashes.. Logcat reports: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.pdfrendererbasic/com.example.android.pdfrendererbasic.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.pdf.PdfRenderer

ITextRenderer: Adjust page height to content

寵の児 提交于 2019-12-09 16:21:54
问题 I'm using ITextRenderer to generate a PDF from HTML and what I need to do is a cash register receipt. This receipt has dynamic width and, of course, dynamic content. This said, the height of content will always be different and right now I'm struggling to find a way of adjusting the height of the PDF page to the content. If it's too big the receipt has a long white section in the end and if it's to short the PDF get's paginated and I need it to be in one page only. I'm using @page {size: Wpx

Need help with pdf-renderer

强颜欢笑 提交于 2019-12-06 12:07:35
问题 I'm using PDF-Renderer to view PDF files within my java application. It's working perfectly for normal PDF files. However, i want the application to be able to display encrypted PDF files. The ecrypted file will be decrypted with CipherInputStream , but i do not want to save the decrypted data on disk. Am trying to figure a way i can pass the decryted data from CipherInputStream to the PDFFile constructor without having to write the decryted data to file. I will also appreciate if someone can

Android Studio - PDFRendererBasic - Unable to replace sample.pdf?

℡╲_俬逩灬. 提交于 2019-12-05 09:57:38
Everytime I edit the PDFRendererBasicFragment java code mFileDescriptor = context.getAssets().openFd("sample.pdf").getParcelFileDescriptor(); to a different pdf placed in the assets folder, the application crashes.. Logcat reports: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.pdfrendererbasic/com.example.android.pdfrendererbasic.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.pdf.PdfRenderer.getPageCount()' on a null object reference Why is this happening? I even tried renaming my PDF to sample.pdf

Need help with pdf-renderer

点点圈 提交于 2019-12-04 15:49:34
I'm using PDF-Renderer to view PDF files within my java application. It's working perfectly for normal PDF files. However, i want the application to be able to display encrypted PDF files. The ecrypted file will be decrypted with CipherInputStream , but i do not want to save the decrypted data on disk. Am trying to figure a way i can pass the decryted data from CipherInputStream to the PDFFile constructor without having to write the decryted data to file. I will also appreciate if someone can help with a link to PDF-Renderer tutorial, so that i can read up more on it. Thanks. Try the following

JavaFX printing non node objects

假如想象 提交于 2019-12-04 15:38:22
I want to print a PDFFile object from the Pdf-Renderer library using javafx printing. Is it possible to print non Node objects? Currently i'm using AWT printing ( check this example ) but it doesn't go well with javafx because my javafx window freezes when the AWT print dialog comes up. Printer printer = Printer.getDefaultPrinter(); PageLayout pageLayout = printer.createPageLayout(Paper.A4, PageOrientation.PORTRAIT, Printer.MarginType.DEFAULT); PrinterJob job = PrinterJob.createPrinterJob(); if (job != null) { boolean success = job.printPage(node); // use something otherthan a node(PDFFile in

How to increase the resolution of image in PDF renderer?

烂漫一生 提交于 2019-11-28 11:25:08
I want to increase the resolution of a image. I used PDFRenderer-0.9.0 jar . It is downloaded from java.net for converting PDF pages to images. I want to Convert 46_2.pdf PDF file to image . The converted 46_2.png image is small with dimensions 612 x 792 [ width x height ] , So I want to increase the image dimensions to 1200 x 1400 [ width x height] . I tried previously PdfBox for converting PDF page into PNG image file. There is a problem only page is converted but text is missing . So I tried PdfRenderer for image conversion. Code: package com.pdfrenderer.examples; import java.awt.Graphics2D

Android's PdfRenderer class produces low quality images

爱⌒轻易说出口 提交于 2019-11-28 07:36:30
I'm using PdfRenderer above api 21 to display pdf in my app and I noticed that the quality of pages is very poor. I followed also google sample to use PdfRenderer and this is how I create Bitmap for page: //mCurrentPage is a PdfRenderer.Page and mImageView is an ImageView Bitmap bitmap = Bitmap.createBitmap(mCurrentPage.getWidth(), mCurrentPage.getHeight(), Bitmap.Config.ARGB_8888); mCurrentPage.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY); mImageView.setImageBitmap(bitmap); I used ARGB_8888 because as far as I know, it's the best quality to display bitmaps. Am i doing

Pdf Viewer using mupdf library [closed]

老子叫甜甜 提交于 2019-11-28 02:08:50
I have tried mupdf library to render my pdf ie. to have my own PDF VIewer, but when i try to form libmupdf.so file using Cygwin on my Windows system, getting errors and .so file not building. plz guide. Download latest android NDK Install CYGWIN Download complete source code of MUPDF (with thirty part tool) Download ANT build for windows set all needed path (JAVA_HOME,ANT_HOME) go to MuPDF directory Run MAKE command Then Import project in android from c:\mupdf\android Run your android project. Don't forget to keep at least one pdf in Downloads folder also follow all the step given in mupdf 来源:

PDF Library for Android - PDFBox? [closed]

孤人 提交于 2019-11-27 03:40:41
Wich libraries exists to use to draw PDF files on Android? I found PDFBox, that is a JSE Library, and want to know if somehow it can be used to draw the PDFs on Android. I know Android converts Standard bytecodes into Dalvik Bytecodes, but how it will convert classes like BufferedImage that the framework can convert PDF Files into? Any suggestion is helpfully, even for paid libraries. 2bard PDF read/writing is a big problem for Android. A quick search on Stackoverflow will reveal many developers looking for solutions. So far, the most popular solution is to use a webview and use the google