We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
here is my code
public static Bitmap getImageFromPdf(Uri pdfUri, Context context) { int pageNumber = 0; PdfiumCore pdfiumCore = new PdfiumCore(context);
try { ParcelFileDescriptor fd = context.getContentResolver().openFileDescriptor(pdfUri, "r"); PdfDocument pdfDocument = pdfiumCore.newDocument(fd); pdfiumCore.openPage(pdfDocument, pageNumber); int width = pdfiumCore.getPageWidthPoint(pdfDocument, pageNumber); int height = pdfiumCore.getPageHeightPoint(pdfDocument, pageNumber); Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); pdfiumCore.renderPageBitmap(pdfDocument, bmp, pageNumber, 0, 0, width, height); // sendTitle(pdfiumCore, pdfDocument, listener1); pdfiumCore.closeDocument(pdfDocument); // important! return bmp; } catch (Throwable e) { e.printStackTrace(); return null; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
here is my code
public static Bitmap getImageFromPdf(Uri pdfUri, Context context) {
int pageNumber = 0;
PdfiumCore pdfiumCore = new PdfiumCore(context);
The text was updated successfully, but these errors were encountered: