pdf_bitmaps 0.0.2 pdf_bitmaps: ^0.0.2 copied to clipboard
A Flutter pdf bitmaps generator and page counter using Android native pdfRenderer.
Package description #
A pdf pages bitmaps genrator and page counter which uses Android PdfRenderer.
Note: This package currently supports only Android native URIs of files not absolute file paths and to get the Android native URIs of files you can use pick_or_save plugin. Why this behaviour? Well because I needed a plugin which can give me pdf bitmaps using a URI so that I can avoid copying the whole pdf into device cache just to generate bitmaps like other plugins do.
Features #
- Generates bitmaps on the fly using Android native URI.
- Gets pdf page count using Android native URI.
Getting started #
- In pubspec.yaml, add this dependency:
pdf_bitmaps:
- Add this package to your project:
import 'package:pdf_bitmaps/pdf_bitmaps.dart';
Basic Usage #
Getting the page count #
int? pageCount = await PdfBitmaps().pdfPageCount(pdfUri: pdfUri)
Getting a pdf page bitmap #
Uint8List? bytes = await PdfBitmaps().pdfBitmap(params: PDFBitmapParams(pdfUri: pdfUri, pageIndex: 2, quality: 3));
Note: pageIndex
starts from 0 to (PdfPageCount - 1) and quality
can be from 1 to 100.
See Example |
---|