pdf renderer might throw security exception on password protected pdf
This commit is contained in:
parent
c5da699afe
commit
1d62cb0024
|
@ -943,7 +943,7 @@ public class FileBackend {
|
||||||
final Bitmap rendered = renderPdfDocument(fileDescriptor, size, true);
|
final Bitmap rendered = renderPdfDocument(fileDescriptor, size, true);
|
||||||
drawOverlay(rendered, paintOverlayBlackPdf(rendered) ? R.drawable.open_pdf_black : R.drawable.open_pdf_white, 0.75f);
|
drawOverlay(rendered, paintOverlayBlackPdf(rendered) ? R.drawable.open_pdf_black : R.drawable.open_pdf_white, 0.75f);
|
||||||
return rendered;
|
return rendered;
|
||||||
} catch (IOException e) {
|
} catch (final IOException | SecurityException e) {
|
||||||
Log.d(Config.LOGTAG, "unable to render PDF document preview", e);
|
Log.d(Config.LOGTAG, "unable to render PDF document preview", e);
|
||||||
final Bitmap placeholder = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
|
final Bitmap placeholder = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
|
||||||
placeholder.eraseColor(0xff000000);
|
placeholder.eraseColor(0xff000000);
|
||||||
|
@ -1357,7 +1357,7 @@ public class FileBackend {
|
||||||
page.close();
|
page.close();
|
||||||
pdfRenderer.close();
|
pdfRenderer.close();
|
||||||
return scalePdfDimensions(new Dimensions(height, width));
|
return scalePdfDimensions(new Dimensions(height, width));
|
||||||
} catch (IOException e) {
|
} catch (IOException | SecurityException e) {
|
||||||
Log.d(Config.LOGTAG, "unable to get dimensions for pdf document", e);
|
Log.d(Config.LOGTAG, "unable to get dimensions for pdf document", e);
|
||||||
return new Dimensions(0, 0);
|
return new Dimensions(0, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue