Hi,
Is there no way to display a PDF using Aspose.pdf library?
There is a need for a PDF viewer on Android OS & the existing solutions such as Qoppa or MuPDF are not dev friendly by any means.
Is adding a viewer on your future release agenda?
Thank you,
Sireesha
Hi Sireesha,
Hi Sireesha,
Adding more to Tilal’s comments, you may consider converting PDF pages to image format and then displaying the images in your Android app. Below is a snippet of code which should assist you:
Java
// open document
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("input.pdf");
// create stream object to save the output image
java.io.OutputStream imageStream = new java.io.FileOutputStream("Converted_Image.jpg");
// create JPEG device with specified attributes
// Quality [0-100], 100 is Maximum
// create Resolution object
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(300);
// create JpegDevice object where second argument indicates the quality of the resultant image
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 100);
// convert a particular page and save the image to stream
jpegDevice.process(pdfDocument.getPages().get_Item(1), imageStream);
// close the stream
imageStream.close();