I have implemented the trial version in my Android app. So far it works great, but for rendering pages to jpeg format it is very slow, like 10 to 15 seconds per page. Is this normal for your library? Are there any performance adjustments I can make to speed things up? Any help is appreciated. Thanks!
Hi Tom,
The PDF files I need to make are of various sized images captured from the camera, with one image per page and the page size matches the size of the image.
public void LoadPageFromPDF(String pdfFilePath, int pageNumber, Point displaySize, ImageView imageView) {
Document pdfDocument = new Document(pdfFilePath);
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(72);
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 100);
Page page = pdfDocument.getPages().get_Item(pageNumber);
ByteArrayOutputStream byteStream = new ByteArrayOutputStream(1024);
jpegDevice.process(page, byteStream); // big time lag here, 6 seconds per page
try {
// We need to do a little extra down-sampling here since we are loading multiple images for full-screen display
Bitmap bmp = decodeSampledBitmapFromByteArray(byteStream.toByteArray(), displaySize.x / 2, displaySize.y / 2);
imageView.setImageBitmap(bmp);
byteStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Hi,