pdfrx library
Classes
- FixedOverscrollPhysics
- A ScrollPhysics that lets you overscroll by up to maxOverscroll and then springs back to the content bounds.
- PdfAnnotation
- PDF annotation information extracted from PDF links.
- 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.
- PdfDocumentLoadCompleteEvent
- Event that is triggered when the PDF document has finished loading.
- 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/caching 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.
- PdfDocumentRefByLoader
- A PdfDocumentRef that loads the document using a custom loader function.
- 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.
- PdfDocumentRefKey
- A key that identifies the source of a PdfDocumentRef.
- PdfDocumentRefUri
- A PdfDocumentRef that loads the document from network.
- PdfDocumentViewBuilder
- A widget that loads PDF document.
- PdfDownloadReport
- PdfFontLoadFailure
- A failed font load.
- PdfFontLoadProgress
- Progress for a font load handled by PdfFontManager.
- PdfFontLoadResult
- Result of PdfFontManager.loadMissingFonts.
- PdfFontManager
- Registers resolved missing fonts through PdfrxEntryFunctions.
- PdfFontManagerAssociation
- PdfFontQuery
- PDF font query parameters.
- PdfFontResolution
- A resolved font candidate.
- PdfFontResolveContext
- Context passed to PdfFontResolver.resolve.
- PdfFontResolver
- Resolves missing PDF fonts to font data that can be registered to pdfrx.
- PdfImage
- Image rendered from PDF page.
- PdfLink
- Link in PDF page.
- PdfLinkHandlerParams
- Parameters to customize link handling/appearance.
- PdfLoadedFont
- Information about a font registered by PdfFontManager.
- PdfOutlineNode
- Outline (a.k.a. Bookmark) node in PDF document.
- PdfOverlayHitTester
- Hit tester for pointer-transparent widgets placed over PdfViewer.
- PdfOverlayInteractionCallbacks
- Interaction callbacks for a registered overlay region.
- PdfOverlayInteractionDetails
- Details for an interaction on a PdfOverlayInteractionRegion.
- PdfOverlayInteractionRegion
- A pointer-transparent overlay region that reports interactions through PdfOverlayHitTester.
- 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.
- PdfPageStatusChange
- Base class for PDF page status change.
- PdfPageStatusModified
- Event that is triggered when a PDF page is modified or newly added.
- PdfPageStatusMoved
- Event that is triggered when a PDF page is moved inside the same document.
- 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
- The class is used to implement Pdfrx's backend functions.
- PdfTextFragmentBoundingRect
- Bounding rectangle for a text range in a PDF page.
- PdfTextSearcher
- Helper class to interactively search text in a PDF document.
- PdfTextSelection
- Interface for text selection information.
- PdfTextSelectionAnchor
- Represents the anchor point of the text selection.
- PdfTextSelectionDelegate
- Delegate for text selection actions.
- PdfTextSelectionParams
- Parameters for text selection.
- PdfTextSelectionPoint
- Represents a point (combination of page and character index) in the text selection. It contains the PdfPageText and the index of the character in that text.
- PdfTextSelectionRange
- Represents a range of text selection between two points.
- 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.
- PdfViewerCoordinateConverter
- Utility class to convert document coordinates to local coordinates and vice versa.
- PdfViewerGeneralTapHandlerDetails
- Describes the type of the tap.
- PdfViewerKeyHandlerParams
- Parameters for the built-in key handler.
- PdfViewerLayoutMetrics
- A container for the calculated scaling limits of the viewer.
- PdfViewerLayoutSnapshot
- Immutable snapshot of the viewer's structural state.
- PdfViewerParams
- Viewer customization parameters.
- PdfViewerScrollInteractionDelegate
- The "Brain" for handling desktop-style pointer interactions (Mouse Wheel, Trackpad).
- PdfViewerScrollInteractionDelegateProvider
- Interface for a factory that creates PdfViewerScrollInteractionDelegate instances.
- PdfViewerScrollInteractionDelegateProviderInstant
- A provider that creates a PdfViewerScrollInteractionDelegate with Instant behavior.
- PdfViewerScrollInteractionDelegateProviderPhysics
- A provider that creates a PdfViewerScrollInteractionDelegate with Physics-based behavior.
- PdfViewerScrollThumb
- Scroll thumb for PdfViewer.
- PdfViewerSelectionMagnifierParams
- Parameters for the text selection magnifier.
- PdfViewerSizeDelegate
- The "Brain" for handling document sizing, zooming, and layout adaptation.
- PdfViewerSizeDelegateLegacy
- The legacy implementation of the sizing delegate.
- PdfViewerSizeDelegateProvider
- Interface for a factory that creates PdfViewerSizeDelegate instances.
- PdfViewerSizeDelegateProviderLegacy
- The default provider that creates the standard sizing behavior.
- PdfViewerSizeDelegateProviderSmart
- A provider that creates a PdfViewerSizeDelegateSmart instance with smart scaling configuration.
- PdfViewerSizeDelegateSmart
- A "Smart" resize delegate that adapts zoom to fit the page width and centers content.
- PdfViewerZoomStepsDelegate
- Delegate to determine the "Zoom Stops" (snap points) for the viewer.
- PdfViewerZoomStepsDelegateDefault
-
Default implementation for
PdfViewerZoomStepsDelegate. - PdfViewerZoomStepsDelegateProvider
- Interface for a factory that creates PdfViewerZoomStepsDelegate instances.
- PdfViewerZoomStepsDelegateProviderDefault
- The default provider that creates the standard zoom stepping behavior.
- PdfViewerZoomStepsDelegateProviderSmart
- The smart provider that creates the standard zoom stepping behavior.
- PdfViewerZoomStepsDelegateSmart
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.
- PdfPageStatusChangeType
- Enum representing the type of PDF page status change.
- PdfrxBackendType
- Pdfrx backend types.
- 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.
Extension Types
- PdfDateTime
- Represents a PDF date/time string defined in PDF 32000-1:2008, 7.9.4 Dates
Extensions
- ImageDartExt on Image
- ImageExt on Image
- OffsetPdfPointExt on Offset
- PdfImageDartExt on PdfImage
- PdfImageExt on PdfImage
- PdfMatrix4Ext on Matrix4
- PdfPageBaseExtensions on PdfPage
- Extension methods for PdfPage.
- PdfPageExt on PdfPage
- PdfPageRenumberedExtension on PdfPage
- Extension to add page renumbering capability to PdfPage.
- PdfPageRotationEnumExtension on PdfPageRotation
- PdfPageWithRotationExtension on PdfPage
- Extension to add rotation capability to PdfPage.
- PdfPointExt on PdfPoint
- PdfRectExt on PdfRect
-
PdfRectsExt
on Iterable<
PdfRect> - Extension methods for List of PdfRect.
- RectExt on Rect
- RectPdfRectExt on Rect
Functions
-
createSimplePasswordProvider(
String? password) → PdfPasswordProvider - Create PdfPasswordProvider that returns the password only once.
-
pdfrxFlutterInitialize(
{bool dismissPdfiumWasmWarnings = false}) → Future< 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.
- PdfDocumentLoadFinished = void Function(PdfDocumentRef documentRef, bool loadSucceeded)
- Function to called when the document loading is finished regardless of success or failure.
- PdfDocumentViewBuilderErrorBuilder = Widget Function(BuildContext context, Object error, StackTrace? stackTrace)
- A function that builds a widget tree when an error occurs while loading the PDF document.
- 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.
-
PdfFontDataLoader
= FutureOr<
Uint8List> Function({PdfFontDataLoadProgressCallback? onProgress}) - Loads font bytes for a PdfFontResolution.
- PdfFontDataLoadProgressCallback = void Function({required int loaded, int? total})
- Called by a PdfFontResolution while it is loading font bytes.
- PdfFontLoadProgressCallback = void Function(PdfFontLoadProgress progress)
- Called while a font resolution is loading font bytes.
- PdfFontLoadResultCallback = void Function(PdfFontLoadResult result)
-
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.
- PdfOverlayInteractionCallback = bool Function(PdfOverlayInteractionDetails details)
- Called when a registered overlay region receives a classified interaction.
- 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 pageRectInViewer, 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, PdfPageRotation? rotationOverride)
- 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.
- PdfViewerCalcMagnifierPositionFunction = Offset? Function(Size? widgetSize, Rect anchorLocalRect, Rect? handleLocalRect, PdfTextSelectionAnchor textAnchor, Offset pointerPosition, {double margin, double? marginOnBottom, double? marginOnTop})
- Function to calculate the position of the magnifier widget in viewport coordinates.
- PdfViewerCalcSelectionAnchorHandleOffsetFunction = Offset Function(BuildContext context, PdfTextSelectionAnchor anchor, PdfViewerTextSelectionAnchorHandleState state)
- Function to calculate the offset for an anchor handle.
-
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) - Function to customize the context menu 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, Offset clampedPointerPosition)
- 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, Offset pointerPosition, Offset magnifierPosition)
- 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.
- PdfViewerSelectionHandlePanEndCallback = void Function(PdfTextSelectionAnchor anchor)
- Callback for when a selection handle pan ends
- PdfViewerSelectionHandlePanStartCallback = void Function(PdfTextSelectionAnchor anchor)
- Callback for when a selection handle pan starts
- PdfViewerSelectionHandlePanUpdateCallback = void Function(PdfTextSelectionAnchor anchor, Offset delta)
- Callback for when a selection handle is being panned
- 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
- PDF exception class.
- PdfPasswordException
- PDF exception for password related errors.