betto_pdf_widgets library
Flutter entry point for betto_pdf_widgets.
Quick start
import 'package:betto_pdfium/betto_pdfium.dart';
final bytes = await File('document.pdf').readAsBytes();
final doc = await PdfDocument.fromBytes(bytes);
try {
final meta = await doc.getMetadata();
print(meta.title);
// Render the first page at 150 DPI:
final size = await doc.getPageSize(0);
final px = size.sizeForDpi(150);
final image = await doc.renderPage(0, px.width.round(), px.height.round());
} finally {
await doc.close();
}
Classes
- AnnotationView
- A widget that displays a list of PDF annotations (notes and highlights).
- DocumentInfoLabels
- Localised label strings for InfoView.
- InfoView
- A read-only panel showing document metadata and file information.
- PageView
- A widget that renders a single page of a PdfDocument.
- PageViewer
- A PDF page viewer widget that supports multiple zoom modes and search-match overlays.
- PdfAnnotation
- Base class for all PDF annotation types.
- PdfColor
- An ARGB colour value as extracted from a PDF annotation.
- PdfDate
- A PDF date value, preserving both the raw string and the parsed DateTime.
- PdfDocument
- A loaded PDF document.
- PdfDocumentInfo
- Document-level properties that are distinct from content metadata.
- PdfFreeTextAnnotation
-
A free-text (typewriter) annotation (
FPDF_ANNOT_FREETEXT). - PdfImage
- A single image object on a PDF page.
- PdfImageBitmap
- A rendered bitmap returned by PdfDocument.renderImage.
- PdfImageMetadata
- Source-level metadata for a single image object in a PDF page.
- PdfInkAnnotation
-
A free-draw ink annotation (
FPDF_ANNOT_INK). - PdfLineAnnotation
-
A line annotation (
FPDF_ANNOT_LINE). - PdfLinkAnnotation
-
A link annotation (
FPDF_ANNOT_LINK). - PdfMarkupAnnotation
- A text markup annotation: highlight, underline, squiggly, or strikeout.
- PdfMetadata
- Metadata extracted from the PDF Info dictionary.
- PdfPageAnnotations
- The annotations extracted from a single PDF page.
- PdfPageImages
- The image objects extracted from a single PDF page.
- PdfPageSize
- The intrinsic size of a PDF page, measured in PDF user units (points).
- PdfPageText
- The result of plain text extraction for a single PDF page.
- PdfPoint
- A point in PDF page coordinates.
- PdfPolygonAnnotation
- A polygon or polyline annotation.
- PdfPopupAnnotation
- Popup annotation data inlined onto a parent annotation.
- PdfQuadPoints
- A set of four corner points defining one quadrilateral region.
- PdfRect
- A bounding rectangle in PDF page coordinates.
- PdfSearchMatch
- A single text-search match returned by PdfDocument.search.
- PdfShapeAnnotation
- A shape annotation: rectangle or ellipse.
- PdfStampAnnotation
-
A rubber stamp annotation (
FPDF_ANNOT_STAMP). - PdfTextAnnotation
-
A sticky note annotation (
FPDF_ANNOT_TEXT). - PdfTextExtractorConfig
- Configuration for text extraction heuristics.
- PdfThumbnail
- A thumbnail image for a PDF page.
- PdfTocEntry
- A single entry in the PDF bookmark/outline tree (Table of Contents).
- PdfUnknownAnnotation
- An annotation whose subtype is not recognised by this library version.
- SearchView
- A search input panel with result list for a PDF document.
- ThumbnailGrid
- A two-column lazy grid of PDF page thumbnails.
- TocView
- A scrollable Table of Contents widget for a PDF document.
- ViewerController
- State controller for a PDF viewer widget.
Enums
- PdfAnnotationType
-
The subtype of a PDF annotation, corresponding to the
fpdf_annot.hFPDF_ANNOT_*constants. - PdfColorspace
-
The colorspace of a PDF image object, corresponding to the
FPDF_COLORSPACE_*constants infpdf_edit.h. - PdfError
- Errors that can occur during PDF document operations.
- PdfSearchFlag
- Flags that control the text-search behaviour of PdfDocument.search.
- PdfThumbnailSource
- Whether a PdfThumbnail came from an embedded stream or was rendered.
- ZoomMode
- Controls how a PDF page is scaled to fit its display area.
Exceptions / Errors
- PdfExtractionException
- Thrown when a PDF operation fails.
- PdfiumException
- A general-purpose exception thrown when an unexpected PDFium native failure occurs.