pdfrx library

Classes

DocumentCoordinateConverter
Utility class to convert document coordinates to local coordinates and vice versa.
FixedOverscrollPhysics
A ScrollPhysics that lets you overscroll by up to maxOverscroll and then springs back to the content bounds.
PdfDest
PDF Explicit Destination the page and inner-page location to jump to.
PdfDocument
Handles PDF document loaded on memory.
PdfDocumentEvent
Base class for PDF document events.
PdfDocumentListenable
The class is used to load the referenced document and notify the listeners.
PdfDocumentMissingFontsEvent
Event that is triggered when the list of missing fonts in the PDF document has changed.
PdfDocumentPageStatusChangedEvent
Event that is triggered when the status of PDF document pages has changed.
PdfDocumentRef
PdfDocumentRef controls loading of a PdfDocument and it also provide you with a way to use PdfDocument safely in your long running async operations.
PdfDocumentRefAsset
A PdfDocumentRef that loads the document from asset.
PdfDocumentRefCustom
A PdfDocumentRef that loads the document from custom source.
PdfDocumentRefData
A PdfDocumentRef that loads the document from data.
PdfDocumentRefDirect
A PdfDocumentRef that directly contains PdfDocument.
PdfDocumentRefFile
A PdfDocumentRef that loads the document from file.
PdfDocumentRefUri
A PdfDocumentRef that loads the document from network.
PdfDocumentViewBuilder
A widget that loads PDF document.
PdfDownloadReport
PdfFontQuery
PdfImage
Image rendered from PDF page.
Link in PDF page.
PdfLinkHandlerParams
Parameters to customize link handling/appearance.
PdfOutlineNode
Outline (a.k.a. Bookmark) node in PDF document.
PdfPage
Handles a PDF page in PdfDocument.
PdfPageFitInfo
PdfViewerController.calcFitZoomMatrices returns the list of this class.
PdfPageHitTestResult
Represents the result of the hit test on the page.
PdfPageLayout
Defines page layout.
PdfPageRawText
PDF's raw text and its associated character bounding boxes.
PdfPageRenderCancellationToken
Token to try to cancel the rendering process.
PdfPageRenderFlags
Flags for PdfPage.render.
PdfPageText
Handles text extraction from PDF page.
PdfPageTextFragment
Text fragment in PDF page.
PdfPageTextRange
Text range in a PDF page, which is typically used to describe text selection.
PdfPageView
A widget that displays a page of a PDF document.
PdfPermissions
PDF permissions defined on PDF 32000-1:2008, Table 22.
PdfPoint
PDF page coordinates point.
PdfRect
Rectangle in PDF page coordinates.
Pdfrx
Class to provide Pdfrx's configuration. The parameters should be set before calling any Pdfrx's functions.
PdfrxEntryFunctions
PdfTextFragmentBoundingRect
Bounding rectangle for a text range in a PDF page.
PdfTextSearcher
Helper class to interactively search text in a PDF document.
PdfTextSelection
Text selection
PdfTextSelectionAnchor
Represents the anchor point of the text selection.
PdfTextSelectionDelegate
Delegate for text selection actions.
PdfTextSelectionParams
Parameters for text selection.
PdfViewer
A widget to display PDF document.
PdfViewerBehaviorControlParams
Parameters to customize the behavior of the PDF viewer.
PdfViewerContextMenuBuilderParams
Parameters for the text selection context menu builder.
PdfViewerController
Controls associated PdfViewer.
PdfViewerGeneralTapHandlerDetails
Describes the type of the tap.
PdfViewerKeyHandlerParams
Parameters for the built-in key handler.
PdfViewerParams
Viewer customization parameters.
PdfViewerScrollThumb
Scroll thumb for PdfViewer.
PdfViewerSelectionMagnifierParams
Parameters for the text selection magnifier.

Enums

PdfAnnotationRenderingMode
Annotation rendering mode.
PdfDestCommand
PDF 32000-1:2008, 12.3.2.2 Explicit Destinations, Table 151
PdfDocumentEventType
PDF document event types.
PdfFontCharset
PDFium font charset ID.
PdfPageAnchor
When PdfViewerController.goToPage is called, the page is aligned to the specified anchor.
PdfPageRotation
Page rotation.
PdfTextDirection
Text direction in PDF page.
PdfTextSelectionAnchorType
Defines the type of the text selection anchor.
PdfViewerGeneralTapType
PdfViewerPart
Where the user taps on.
PdfViewerTextSelectionAnchorHandleState
State of the text selection anchor handle.

Functions

createSimplePasswordProvider(String? password) PdfPasswordProvider
Create PdfPasswordProvider that returns the password only once.
pdfrxFlutterInitialize({bool dismissPdfiumWasmWarnings = false}) → void
Explicitly initializes the Pdfrx library for Flutter.
pdfrxInitialize({String? tmpPath, String? pdfiumRelease}) Future<void>
Initializes the Pdfrx library for Dart.

Typedefs

PdfDocumentLoaderProgressCallback = void Function(int downloadedBytes, [int? totalBytes])
Callback function to notify download progress.
PdfDocumentViewBuilderFunction = Widget Function(BuildContext context, PdfDocument? document)
A function that builds a widget tree with the PDF document.
PdfDownloadProgressCallback = void Function(int downloadedBytes, [int? totalBytes])
Callback function to notify download progress.
PdfLinkCustomPagePainter = void Function(Canvas canvas, Rect pageRect, PdfPage page, List<PdfLink> links)
Custom painter for the page links.
PdfLinkWidgetBuilder = Widget? Function(BuildContext context, PdfLink link, Size size)
Function to build link widget for PdfLink.
PdfMatrixNormalizeFunction = Matrix4 Function(Matrix4 matrix, Size viewSize, PdfPageLayout layout, PdfViewerController? controller)
Function to normalize the matrix.
PdfPageChangedCallback = void Function(int? pageNumber)
Function called when the current page is changed.
PdfPageLayoutFunction = PdfPageLayout Function(List<PdfPage> pages, PdfViewerParams params)
Function to customize the layout of the pages.
PdfPageLoadingCallback<T> = FutureOr<bool> Function(int currentPageNumber, int totalPageCount, T? data)
PdfPageOverlaysBuilder = List<Widget> Function(BuildContext context, Rect pageRect, PdfPage page)
Function to build page overlays.
PdfPageViewDecorationBuilder = Widget Function(BuildContext context, Size pageSize, PdfPage page, RawImage? pageImage)
Function to build a widget that wraps the page image.
PdfPageViewSizeCallback = Size Function(Size biggestSize, PdfPage page)
Function to calculate the size of the page based on the size of the widget.
PdfPasswordProvider = FutureOr<String?> Function()
Function to provide password for encrypted PDF.
PdfViewerCalculateCurrentPageNumberFunction = int? Function(Rect visibleRect, List<Rect> pageRects, PdfViewerController controller)
Function to guess the current page number based on the visible rectangle and page layouts.
PdfViewerCalculateInitialPageNumberFunction = int? Function(PdfDocument document, PdfViewerController controller)
Function to calculate the initial page number.
PdfViewerCalculateZoomFunction = double? Function(PdfDocument document, PdfViewerController controller, double fitZoom, double coverZoom)
Function to calculate the initial zoom level.
PdfViewerContextMenuBuilder = Widget? Function(BuildContext context, PdfViewerContextMenuBuilderParams params)
Function to build the text selection context menu.
PdfViewerContextMenuUpdateMenuItemsFunction = void Function(PdfViewerContextMenuBuilderParams params, List<ContextMenuButtonItem> items)
PdfViewerDocumentChangedCallback = void Function(PdfDocument? document)
Function to notify that the document is loaded/changed.
PdfViewerErrorBannerBuilder = Widget Function(BuildContext context, Object error, StackTrace? stackTrace, PdfDocumentRef documentRef)
Function to build loading error banner.
PdfViewerGeneralTapHandler = bool Function(BuildContext context, PdfViewerController controller, PdfViewerGeneralTapHandlerDetails details)
Function to handle tap events.
PdfViewerGetMagnifierRectForAnchor = Rect Function(PdfTextSelectionAnchor anchor, PdfViewerSelectionMagnifierParams params)
Function to get the magnifier rectangle for the anchor.
PdfViewerGetPageRenderingScale = double Function(BuildContext context, PdfPage page, PdfViewerController controller, double estimatedScale)
Function to customize the rendering scale of the page.
PdfViewerHandleLinkTap = bool Function(Offset position)
Function to handle link tap.
PdfViewerLoadingBannerBuilder = Widget Function(BuildContext context, int bytesDownloaded, int? totalBytes)
Function to build loading banner.
PdfViewerMagnifierBuilder = Widget? Function(BuildContext context, PdfTextSelectionAnchor textAnchor, PdfViewerSelectionMagnifierParams params, Widget magnifierContent, Size magnifierContentSize)
Function to build the magnifier widget.
PdfViewerMagnifierShouldBeShownFunction = bool Function(PdfTextSelectionAnchor textAnchor, PdfViewerController controller, PdfViewerSelectionMagnifierParams params)
Function to determine whether the magnifier should be shown or not.
PdfViewerOnKeyCallback = bool? Function(PdfViewerKeyHandlerParams params, LogicalKeyboardKey key, bool isRealKeyPress)
Function to handle key events.
PdfViewerOverlaysBuilder = List<Widget> Function(BuildContext context, Size size, PdfViewerHandleLinkTap handleLinkTap)
Function to build viewer overlays.
PdfViewerPagePaintCallback = void Function(Canvas canvas, Rect pageRect, PdfPage page)
Function to paint things on page.
PdfViewerReadyCallback = void Function(PdfDocument document, PdfViewerController controller)
Function called when the viewer is ready.
PdfViewerTextSelectionAnchorHandleBuilder = Widget? Function(BuildContext context, PdfTextSelectionAnchor anchor, PdfViewerTextSelectionAnchorHandleState state)
Function to build the text selection anchor handle.
PdfViewerTextSelectionChangeCallback = void Function(PdfTextSelection textSelection)
Function to be notified when the text selection is changed.
PdfViewerViewSizeChanged = void Function(Size viewSize, Size? oldViewSize, PdfViewerController controller)
Function to be called when the viewer view size is changed.

Exceptions / Errors

PdfException
PdfPasswordException