dart_pdf_editor library

Flutter widgets for viewing and editing PDF documents.

Classes

CanvasPdfDevice
Paints interpreter callbacks onto a Flutter Canvas.
CreateSigningIdentityForm
The body of the create-identity dialog, exposed on its own so it can be embedded (e.g. in a settings page) and tested without a Dialog host.
DartPdfEditorLocalizations
Callers can lookup localized strings with an instance of DartPdfEditorLocalizations returned by DartPdfEditorLocalizations.of(context).
InMemoryFormSecretStore
A PdfFormSecretStore held in memory - values live only as long as the store object. Used for tests, and by hosts (the web app) that must not persist passwords at all.
InMemoryIdentityStore
An in-memory PdfIdentityStore - identities live only for the session. Useful for tests and for a "don't remember me" flow.
PdfActionBarAction
One action of a PdfActionBarRequest.
PdfActionBarRequest
What PdfEditorPresenter.actionBar draws.
PdfAnnotationAppearancePreview
A small card showing annotation's rendered normal appearance, fitted into width x height - the leading preview of the annotation list and the annotation library.
PdfAnnotationLibraryDialog
Legacy modal wrapper for hosts that have not adopted PdfAnnotationLibraryPanel. The stock PdfEditorView uses the dockable panel.
PdfAnnotationLibraryPanel
A dockable, searchable library of reusable annotation snapshots.
PdfAnnotationMenuItem
One entry in the annotation context menu. Hosts add their own through PdfViewer.annotationMenuBuilder; the stock entries (z-order, delete) are built the same way internally.
PdfAnnotationMenuRequest
What an annotation context menu acts on: the controller and the selection at the moment the menu opened. The right-clicked annotation is always part of the selection (the viewer selects it before the menu shows); a right-click on an already-selected annotation keeps a multi-selection intact, so annotations can hold several entries.
PdfAnnotationPropertiesPanel
A panel showing - and editing - the selected annotation's properties.
PdfAnnotationSidebar
A panel listing every annotation in the document, grouped by page, each tile showing its author (/T) when the annotation carries one. Form-field tiles show the field's kind, fully qualified name, and current value; link tiles show the text under the link and where it goes (the URI, or the target page).
PdfAnnotationSnapshot
A self-contained copy of one annotation: its dictionary with every referenced object - appearance streams included - resolved and copied inline, detached from the document it came from.
PdfAnnotationSnapshotClipboard
A clipboard for copied annotations, shared across documents: copy or cut annotations in one PdfEditingController, then paste them back into the same document - or into a different open document tab, since every controller shares the process-wide instance by default.
PdfAnnotationTapDetails
Information about a PDF annotation tap.
PdfArmToolIntent
Arms tool, or drops back to Select when it is already armed - a tool's single-key shortcut (PdfViewer.toolShortcuts). Goes through the editor's commands when they drive the session, so a measure tool still asks for its scale first. Editing only.
PdfAutosizeTextBoxIntent
Shrinks or grows the selected text box to fit its text (⌥Z / Alt+Z). Editing only.
PdfBookmarkSidebar
Dockable PDF outline/bookmarks panel.
PdfBudgetedCache<K, V>
One bounded, least-recently-used cache that every in-package cache is built on, so the eviction rules live (and are property-tested) in exactly one place instead of being re-derived - subtly differently, and with a fresh off-by-one each time - at six call sites.
PdfBundledFont
A font offered in the font menu without a file picker, its bytes loaded lazily on pick (loadBundledFont).
PdfBundledFontChoice
A PdfBundledFont, loaded and embedded on pick.
PdfBytesByteSource
A PdfByteSource backed by a complete in-memory buffer. Handy for tests and for adapting already-downloaded bytes to the source-based API.
PdfByteSource
A random-access, possibly asynchronous source of PDF bytes.
PdfCacheRegistry
The one place a memory-pressure signal fans out to every in-process cache.
PdfCachingRenderWorker
Wraps a PdfRenderWorker with an LRU cache of completed record results, keyed by (page, annotations + hidden subtypes, decodeImages, image-ratio bucket, command-limit, image-decode-region when decoded image bytes are present). The lazy page list recycles a PdfPageView's State when it scrolls out of view and re-creates it on the way back, dropping the State's cached picture - so without this every scroll-back re-asks the worker to decode the page from scratch (a multi-second inflate + colour-convert on a raster-heavy CAD sheet, observed re-running ~7× for one page during a single scroll). A page's bytes don't change under the worker (it holds a fixed snapshot), so a completed buffer stays valid for the worker's whole life - caching it makes a revisit a map lookup instead of a re-decode. The cache lives on the worker, so it is shared across every recycled page widget and dies with the worker (a new document opens a new worker, hence a fresh cache).
PdfCancelToken
Cooperative cancellation for a PdfHttpByteSource. Call cancel to stop an in-progress or subsequent load; pending and future reads then throw a PdfHttpCancelledException. A token is single-use.
PdfCanvasTileRasterBackend
The universal retained-scene renderer used today and as a fallback for accelerated backends.
PdfClipboardPdf
A PDF clipboard representation and an optional native clipboard revision. changeToken must change on every clipboard replacement, including when the bytes are identical. Once pasted, an unchanged revision yields to the in-app clipboard so a subsequent local annotation copy remains usable. Omit the token when the host cannot observe clipboard revisions.
PdfColorPicker
A compact full-spectrum color picker: a saturation/value area, a hue slider, a value row - hex, RGB, HSL, or CMYK, switchable - kept in sync, and a grid of quick-pick swatches (a fixed palette plus, when supplied, the colours recently chosen and the colours already used in the document). Annotation opacity is a separate controller property, so the picker deals in opaque colors.
PdfColorRequest
What PdfEditorPresenter.color asks for.
PdfColorResult
The answer to a PdfColorRequest: a picked color, or a request to sample one off the page.
PdfCommand
One thing the editor can do, described as data: what to call it, how to draw it, whether it applies right now and how to run it.
PdfComparisonController
Drives a document comparison view: it pairs the two documents' pages, computes a word-level text diff per matched page (a PdfTextDiff), and exposes the resulting changes as an ordered, navigable list - the model behind the diff navigator panel.
PdfComparisonView
Compares two PDF documents visually.
PdfConfirmRequest
What PdfEditorPresenter.confirm asks.
PdfContextMenuRequest
A context menu the host is asked to render, with everything the viewer already resolved about the gesture.
PdfCopyIntent
Copies the selection: selected annotations to the editing clipboard, or the selected text to the system clipboard (⌘C / Ctrl+C).
PdfCustomStamp
A reusable rubber stamp: visual template plus optional app metadata.
PdfCutIntent
Cuts the selected annotations (⌘X / Ctrl+X). Editing only.
PdfDebugDetailRegions
Debug registry of each page's current legacy detail-patch bounds, as fractions (0..1) of the page. Page views report on build (only while pdfDebugPaintDetailBounds is on); the thumbnail overlay draws them so the strip shows where each page's patch sits. Same microtask coalescing as PdfLivePageRegistry - reports arrive mid-build.
PdfDeleteSelectionIntent
Deletes the selected annotations or page content (Delete / Backspace). Editing only.
PdfDialogRequest<T>
What PdfEditorPresenter.dialog shows.
PdfDialogSubmit
Marks the primary action in a showPdfDialog as its Enter action.
PdfDiffChange
A single navigation stop in the diff - a text hunk on a page, or a whole inserted/removed page. Carries the page-space bounds on each side so a side-by-side view can frame both panes and an overlay can frame one.
PdfDiffNavigatorPanel
Lists every change in a PdfComparisonController, grouped by page - tap to jump, mirroring PdfSearchResultsPanel's shape. The inner edge is draggable.
PdfDigitalSignatureIdentity
A certificate-backed identity used to create a cryptographic PDF signature.
PdfDismissIntent
Backs out one layer: a colour pick or crop, a placement, the selection, the armed tool, then the text selection (Escape).
PdfDocument
A PDF document with page-level semantics on top of the COS layer.
PdfDocumentFontChoice
A font already embedded in the open document.
PdfDropdown<T>
A drop-down picker in the look of Material's DropdownButton (or, with decoration, DropdownButtonFormField) whose options open through the PdfEditorPresenter's menu - a route the editor's scope reaches, so it works under any host and a host presenter draws it too.
PdfDropdownItem<T>
One option of a PdfDropdown.
PdfEditingController
An editing session over a PDF document: applies edits through PdfEditor, owns the resulting document revisions, and carries the UI state of the editing tools (active tool, color, pending ink strokes, selected annotation).
PdfEditingInteractionHost
The viewer-owned services an editing interaction may request.
PdfEditingInteractionSession
Stable event → state/effect surface for editing gestures.
PdfEditingInteractionState
Immutable diagnostic view of PdfEditingInteractionSession.
PdfEditingPreferences
Editing-UI preferences, persisted on the local device.
PdfEditingToolbar
A ready-made toolbar for PdfEditingController.
PdfEditorCommands
The editor's intents as one object: arm a tool (asking for whatever it needs first), open a tool group, apply text markup or a colour, flatten, and the recently used tools - what the stock PdfEditingToolbar runs and what a host's own toolbar, menu, command palette or keyboard handler can run too, with the same results.
PdfEditorCommandsScope
Provides commands to the subtree, for PdfEditorCommands.of.
PdfEditorFeatures
Which pieces of chrome a PdfEditorView shows. Everything defaults on; turn features off rather than rebuilding the layout by hand.
PdfEditorLocalizations
The localizations delegates to register at the root of an app that hosts the editor.
PdfEditorNotice
A transient, non-blocking message (PdfEditorPresenter.notice).
PdfEditorPanel
A host's own panel, shown by PdfEditorView(extraPanels: [...]) beside the stock ones: a toggle in the panel switch (and the compact Controls sheet), a frame on its dock with a resize grip and a move handle that redocks it to another edge, and a bottom sheet on compact layouts. Its dock, width and - unless open is given - whether it is open persist in PdfEditingPreferences, keyed by id.
PdfEditorPresenter
How the editor presents its UI: dialogs, bottom sheets, popup menus, transient notices, and the prompts it asks (text, colour, font, link, measurement scale, page ranges, signatures, ...).
PdfEditorScope
Carries a PdfEditorPresenter - and optionally the editor's design tokens (theme) and a platform override - to the editor widgets below it.
PdfEditorThemeData
Design tokens for the editor's chrome (header, toolbar, panels, sheets and notices) plus the viewer's canvas tokens (viewer). Every field is optional; a null keeps the stock look.
PdfEditorView
A drop-in PDF editor: the PdfViewer with every editing tool wired up - header with search and panel toggles, thumbnail/annotation/ properties panels, and the bottom editing toolbar. For a view-only widget, use PdfReader.
PdfFontCatalogEntry
One row of the font menu's catalogue (PdfFontRequest.entries).
PdfFontChoice
What the font menu's picker answers (PdfEditorPresenter.font): a standard family, a bundled, platform or document font, or the "Load font…" action. The menu loads and applies it.
PdfFontMenuButton
A compact button showing the current font that opens showPdfFontMenu.
PdfFontRequest
What PdfEditorPresenter.font asks for: one of entries (or recent).
PdfFormChoiceRequest
What PdfEditorPresenter.formChoice asks for.
PdfFormFieldMenuRequest
What the form tool's field context menu acts on.
PdfFormFieldStyle
The text styling of a form text field, read from its /DA, /Q and /Ff - what the form-field style controls reflect and edit (PdfEditingController.selectedFormFieldStyle).
PdfFormOptionsEdit
What the choice-field options editor hands back: the (export value, display text) pairs in order, plus the one flag that applies to the field's kind - editable for a combo box, multiSelect for a list box (the other is null).
PdfFormOptionsEditor
The dialog body of showPdfFormOptionsDialog: one row per option with its export value and display text, an add button, and the combo box's "allow custom text" or the list box's "allow multiple selections" switch. Pops a PdfFormOptionsEdit on save.
PdfFormSecretStore
Where PdfEditingController keeps password-field values instead of the PDF (ISO 32000 §12.7.4.3: readers "shall never store the value" of a password field in the file).
PdfGpuRasterRouteOverlay
A non-interactive page overlay for pdfDebugShowGpuRasterRoutes.
PdfHeaderParts
The stock header's controls, for a PdfEditorView.headerBuilder that lays out its own header: place the parts you want, in your own bar, next to your own controls.
PdfHttpByteSource
A PdfByteSource that reads a remote PDF over HTTP(S), using Range requests when the server supports them and transparently falling back to a single full download when it does not.
PdfIdentityStore
Persistence for one-tap PdfSigningIdentitys (see PdfSigningIdentity.generate). An identity is stored by a caller-chosen id as its PEM (toPem()), which carries the unprotected private key - so the production backend, SecureIdentityStore, keeps it in the platform Keychain/Keystore rather than in preferences.
PdfImageCache
A process-wide cache of decoded image XObjects, so repeat renders of a page reuse the already-decoded ui.Image instead of re-running the codec. The same image is decoded once and shared by every render path - the on-screen page, its thumbnail, the fast-scroll preview, the eyedropper sampler, and re-renders after a zoom/page-colour/annotation change - for the life of the document.
PdfInkSignature
A hand-drawn signature, stored device-side and stamped onto pages as an Ink annotation (PdfEditingController.placeSignature).
PdfInsertFile
A PDF the host read for "Insert pages": its display name and bytes.
PdfInsertPagesPlan
What the insert-pages dialog settled on - pass it to PdfInsertPagesPlan.applyTo (or the fields to PdfEditingController.insertPages).
PdfKeyboardAvailability
Whether a physical keyboard is available for shortcut hints and settings.
PdfLinkRequest
What PdfEditorPresenter.link asks for.
PdfLinkTarget
Where a hyperlink created by the link tool points: either an external PdfLinkTarget.uri (a web address, mailto:, or app scheme) or an in-document jump to a PdfLinkTarget.page (a whole-page fit) or a more specific PdfLinkTarget.destination (a position, zoom, or rectangle).
PdfLivePageRegistry
Debug registry of the page indices with a live page-view state (created in initState, removed on dispose). Only the active document's viewer builds page views, so indices are unambiguous. Feeds pdfDebugShowRenderWindow; maintained always (a set add/remove per page lifecycle is noise) so the overlay is truthful the moment it is enabled.
PdfLiveRasterBudget
Process-wide budget over the rasters live page views hold simultaneously.
PdfLiveRasterHolder
A live page whose GPU/decoded raster memory is counted against the global PdfLiveRasterBudget. Implemented by the page view's state.
PdfLoadFontChoice
"Load font…": the menu asks its font picker for a file.
PdfMaterialHost
Supplies what the editor's stock (material_ui) chrome needs when the host app does not: Material and Cupertino localizations, a Theme, and a transparent Material for ink and text fields.
PdfMeasurementInput
The answer to a PdfMeasurementInputRequest.
PdfMeasurementInputRequest
What PdfEditorPresenter.measurementInput asks for.
PdfMeasurementScale
A measurement calibration the editing UI carries: how many real-world units one PDF point represents, the unit label, and the display precision. Persisted in PdfEditingPreferences so a drawing's scale survives reopening the file.
PdfMeasurementScaleRequest
What PdfEditorPresenter.measurementScale asks for.
PdfMemoryPreferencesStore
A PdfPreferencesStore held in memory: nothing outlives the process. For tests, kiosks and hosts that persist values themselves.
PdfMemoryPressureListener
Memory held outside every PdfBudgetedCache that can still be let go on request - a render worker's own decode caches, which live in another isolate or Web Worker where no registered cache can reach.
PdfMenuDivider<T>
A rule between groups of PdfMenuItems.
PdfMenuEntry<T>
One row of a PdfMenuRequest: a PdfMenuItem or a PdfMenuDivider.
PdfMenuItem<T>
A pickable (or, while not enabled, greyed) menu row.
PdfMenuRequest<T>
What PdfEditorPresenter.menu shows: entries anchored at anchor.
PdfMoveDragPreview
A single-selection move drag's floating preview.
PdfNudgeSelectionIntent
Moves the selected annotations, or the selected page content, by (dx, dy) page points, y down the screen (the arrow keys: 1 pt, 10 pt with Shift). Enabled only while something is selected, so an arrow key still scrolls the page when nothing is.
PdfOcrEngine
A pluggable OCR engine: given a rasterized page, returns recognized text runs positioned in PDF user space.
PdfOcrPageImage
A rasterized page handed to a PdfOcrEngine, with the geometry to map pixel boxes back to PDF user space.
PdfOcrRasterizer
Produces the page raster handed to a PdfOcrEngine.
PdfPageClipboard
A clipboard for whole PDF pages, shared across documents: copy or cut pages in one PdfEditingController's thumbnail view, then paste them into the same document - or into a different open document tab, since every controller shares the process-wide instance by default.
PdfPageColorSampler
Pixel access to a page rendered once, for repeated color sampling - the eyedropper's live preview follows the pointer, and re-rendering per event would be far too slow.
PdfPageComparison
Compares rendered PDF pages and builds diff images.
PdfPageDiff
A page-pair comparison: the pixel diff plus the changed regions in each page's own PDF coordinate space, ready for showRect navigation.
PdfPageDragOut
A page-tile drag that has left the window its thumbnail panel lives in - see PdfThumbnailDropController.onPageDropOutside.
PdfPageExport
Exports PDF pages to PNG/JPEG image bytes.
PdfPageGeometry
Converts between a page's PDF user space (origin bottom-left, y up, points) and the view space of the widget displaying it (origin top-left, y down, logical pixels), including the page's /Rotate.
PdfPageLayout
How PdfViewer arranges the document's pages.
PdfPageNumberField
The classic "page 3 / 12" indicator, with the page number editable: type a number and press enter to jump there.
PdfPageObjectCache<V>
A bounded, least-recently-used cache keyed by page index.
PdfPagePair
One aligned page pair.
PdfPagePreviewCache
Low-resolution page previews shown while a page's full render is pending - most visibly during fast scrolling, when PdfPageView holds the (UI-thread) first interpretation of pages flying past and would otherwise show blank paper.
PdfPagePreviewFrame
One owned preview clone plus the quality metadata needed to promote a live page without accidentally downgrading it when an LRU eviction occurs.
PdfPagePreviewLodPolicy
Memory and background-work policy for the middle steps in the page-preview ladder.
PdfPagePreviewLodStats
Snapshot of the preview pyramid's retained working set.
PdfPageRange
An inclusive, zero-based page range for one output PDF.
PdfPageRangeRequest
What PdfEditorPresenter.pageRange asks for.
PdfPageRasterCachePolicy
Memory policy for full-resolution rasters of pages the user has visited.
PdfPageRasterGeometry
The resolution and physical pixel size a page raster is baked at.
PdfPageRasterSignature
Everything that changes the pixels of a baked full-resolution page raster.
PdfPageRasterWarmPolicy
Whether - and how far ahead - the viewer bakes exact, display-sized page rasters for pages the user has not visited.
PdfPageRasterWarmStats
A snapshot of what the idle full-raster warm and the exact-raster cache have actually done - the diagnostic counterpart to PdfPageRasterWarmPolicy.
PdfPageReconciliationDiagnostics
Support snapshot for the most recent page-list reconciliation.
PdfPageRenderer
Rasterizes PDF pages.
PdfPageRenderIntent
The page and viewport state that determines what pixels a page view needs.
PdfPageRenderPlan
Immutable display inputs for rendering a page.
PdfPageRenderScheduler
PdfPageRenderSession
Owns page-render identity, invalidation, scheduling, and result freshness.
PdfPageRenderTransition
Actions required when a page render session receives a new intent.
PdfPageSurfaceRegion
A y-down page-space slice painted into a worker-owned browser surface.
PdfPageSurfaceSession
A browser-owned page canvas bound to one render worker.
PdfPageView
Displays a single PDF page, rendered natively in Dart.
PdfPanelDragFeedback
The chip that follows the pointer while a panel is being redocked or dragged onto another panel to form a tab group.
PdfPanelDragScope
Ambient wiring that lets a docked panel's move handle drive the shell's drag-to-redock affordance. PdfShellPanelLayout provides it around the panels; a panel's PdfSidebarPanelGeometry.moveHandle reads it. Reads as absent (maybeOf returns null) when a shell wires no redocking - then panels render no move handle.
PdfPanelToggleButton
One square toggle in the search panel's control row: a compact icon or short glyph ("Aa", ".*") that lights up when selected.
PdfPasteIntent
Pastes the editing clipboard, or a system clipboard image or text, at the pointer (⌘V / Ctrl+V). Editing only.
PdfPencilInteraction
Bridges the Apple Pencil's hardware double-tap gesture to an editing action - by default toggling the eraser on the attached controller, but only when the user's iOS setting asks for a tool switch.
PdfPerfLog
Lightweight, frame-gated performance log for diagnosing scroll/render hangs on heavy documents.
PdfPerformanceController
Owns adaptive state for one shell/viewer and exposes diagnostics.
PdfPerformanceDiagnostics
Snapshot suitable for a diagnostics panel or support log.
PdfPerformanceEnvironment
Stable inputs known when a document worker is opened.
PdfPerformanceMode
Fixed performance settings or an adaptive policy with a worker ceiling.
PdfPerformancePolicy
Deterministic policy functions, split from the controller for direct tests.
PdfPerformanceSample
One synthetic or observed performance sample. Durations are optional so callers can feed the signals they own without manufacturing the rest.
PdfPerformanceTuning
Runtime knobs selected by PdfPerformanceController.
PdfPixelDiff
The pixel-level result of comparing two equal-size RGBA rasters.
PdfPlatformFont
A font discovered on the host platform (e.g. an OS-installed family), offered as a font-menu choice. The editor can't read font files itself (dart:io is banned in lib/ so the package keeps running on the web), so the host app discovers these and registers them in pdfPlatformFonts: a label, the engine font family to preview the menu entry with (optional) and a lazy byte loader called only when the font is chosen - its outlines then embed into the document so the text renders everywhere.
PdfPlatformFontChoice
A PdfPlatformFont, read and embedded on pick.
PdfPooledRenderWorker
Fans record calls across a fixed set of platform workers so up to N pages decode at once instead of one at a time. A single worker serializes every page; on a document whose sheets are each a multi-second image decode that makes the tail crawl. Spreading the work across a pool drains it ~N× faster - the visible burst on load and the background prefetch alike.
PdfPreferencesStore
The key-value storage behind PdfEditingPreferences (PdfEditingPreferences(store:)).
PdfProgressiveSourceBuilder
Builds a viewer subtree progressively from an asynchronous PdfByteSource.
PdfRasterCache
Persists low-resolution page rasters to a PdfDiskCache so a document reopened in a later session shows soft page content immediately - instead of blank paper - while the (heavy, twice-over-the-content- stream) full render computes.
PdfRasterCacheStats
Counters for the persistent full-raster tier: whether it is paying for itself, and what it costs.
PdfRasterProbe
Measures one rasterize call: its wall duration AND how many rasters were in flight alongside it.
PdfReader
A drop-in, view-only PDF widget: the PdfViewer plus a slim header with search, a page-number field, view options, and a navigational thumbnail sidebar. No editing - for the full editor, use PdfEditorView.
PdfReaderFeatures
Which pieces of chrome a PdfReader shows. Everything defaults on; turn features off rather than rebuilding the layout by hand.
PdfReadoutRequest
What PdfEditorPresenter.readout draws.
PdfRedoIntent
Redoes the last undone edit (⌘⇧Z / Ctrl+Shift+Z / Ctrl+Y). Editing only.
PdfReflowBackend
Drives a PdfViewer and reports its state: current page, zoom, and search results. Listeners fire on any change. The subset of viewer navigation a text reading view (PdfReflowView) implements so the shared PdfViewerController can drive it - page jumps, the visible-region indicator, and saved-position capture/restore - while no page PdfViewer is mounted.
PdfReflowView
A text-first view of a PDF document.
PdfRegionClipState
PdfRegionReplayUnit
PdfRendererOcrRasterizer
OCR rasterizer backed by PdfPageRenderer.renderImage.
PdfRenderPhaseBudget
Per-phase upper bounds for a PdfRenderTrace, in microseconds.
PdfRenderTrace
One end-to-end, per-phase record of a single page render, spanning both isolates.
PdfRenderWorker
Records a PDF page's interpreter callbacks into a portable command buffer OFF the UI thread, so the dominant render cost - the content-stream parse and interpreter walk - stops blocking frames while scrolling.
PdfRetainedScene
A page retained as a replayable scene: the recorded interpreter command buffer plus its decoded images, both produced exactly once in record.
PdfRetainedSceneHandle
A pinned reference to a complete retained page scene.
PdfSavedAnnotation
A named, reusable annotation captured as a detached PdfAnnotationSnapshot.
PdfSavedAnnotationPreview
The stock annotation library's leading preview: the saved annotation's rendered appearance on a white card (PdfAnnotationAppearancePreview).
PdfSavedSignature
A named signature in the device-side signature library.
PdfScaleDialog
The scale-calibration dialog shown by showPdfScaleDialog. The user expresses the drawing's scale as "1 inch on the page equals N real units" - the most common way drawing scales are quoted - or taps "Calibrate" (when onCalibrate is set) to measure a known length on the page instead.
PdfSceneBuildTiming
Mutable carrier for the image-decode half of a PdfRetainedScene.fromCommands build, so the perf log can split the render 'build' phase into decode vs canvas-call construction without PdfRetainedScene.fromCommands growing a second return channel. The caller allocates one only while PdfPerfLog.enabled - an ordinary render never pays for it.
PdfScrollbar
The viewer-style scrollbar: a light thumb with a dark outline over a faint track scrim - always visible while the content overflows, widening on hover, draggable from the first pixel, and jumping (then dragging) on a track grab. PdfViewer paints it outside the zoom transform so it keeps its place and size at any zoom, and the sidebars mount the same bar over their lists so every scrollbar in the chrome looks and behaves alike. Colors follow PdfViewerThemeData.scrollbar.
PdfScrollbarMarker
A labelled location on a PdfScrollbar track.
PdfScrollbarThemeData
Colors for the viewer-style scrollbar (PdfScrollbar in the viewer and both sidebars). Null fields fall back to the stock palette - a light capsule with a dark outline, chosen to read against the dark canvas, white pages, and light or dark panel surfaces alike.
PdfScrollMetrics
A read-only snapshot of a PdfViewer's scroll state along its main layout axis, enough to drive a custom scroll indicator or page scrubber without reaching into the viewer's private scroll controller. Read it from PdfViewerController.scrollMetrics (or the PdfScrollIndicatorBuilder), and listen to PdfViewerController.viewportChanges to know when to re-read it.
PdfSearchField
A compact document-search field: a slim text box with the match count, previous/next, and clear riding alongside - small enough for an app bar.
PdfSearchOptions
How a document search matches text: case sensitivity, whole-word boundaries, and regular-expression mode. Held by PdfViewerController.searchOptions; the search field and results panel expose them as toggle controls.
PdfSearchResult
One search hit with the text around it, ready for a results list like PdfSearchResultsPanel.
PdfSearchResultsPanel
A side panel listing every search hit with its surrounding text, grouped by page - tap one to jump there.
PdfSelectAllIntent
Selects every annotation on the current page with the select tool, or the page's whole text otherwise (⌘A / Ctrl+A).
PdfSelectedContentImage
A selected page-content image exported by the Content tool.
PdfSharedPreferencesStore
A PdfPreferencesStore over a SharedPreferences instance - what PdfEditingPreferences uses when no store is passed.
PdfSheetRequest<T>
What PdfEditorPresenter.sheet shows.
PdfSidebarCloseButton
A compact close (×) button for a docked sidebar panel's header - the desktop counterpart of the bottom sheet's close button (which the sheet chrome supplies on its own). A panel renders this in its header only when the host wires an onClose and the panel is docked, not a sheet.
PdfSidebarMoveHandle
The grab handle a docked panel shows in its header: drag it onto another edge's drop zone to redock the panel. Renders nothing when no PdfPanelDragScope is in scope (the shell wires no redocking).
PdfSidebarPanelFrame
Shared docked/bottom-sheet frame for sidebar panels.
PdfSidebarPanelGeometry
Geometry and shared chrome supplied to a sidebar panel's content builder.
PdfSidebarResizeGrip
The draggable divider on a sidebar's inner edge: an invisible 8px hit strip with a hairline down the middle that thickens and tints on hover and while dragging. Reports width deltas already signed toward growth, whichever side the panel is docked on. Used by the left/right docks and by the comparison navigator.
PdfSignatureDialog
A dialog with a drawing pad for capturing a signature: draw with mouse, finger, or stylus (pressure is recorded and rendered as variable width, like the ink tool), pick an ink color - one of the three pen presets or any colour at all, through the picker behind the custom swatch - set the pen thickness, clear, done. With a trackpad capture it can also be drawn with a finger on the trackpad.
PdfSignatureLibraryDialog
Standard picker for adding, choosing, renaming, redrawing, and deleting handwritten signatures.
PdfSignaturePad
A signature drawing pad: draw with a mouse, finger or stylus (stylus pressure is recorded and drawn as variable width, like the ink tool), or - with a trackpad capture and PdfSignaturePadController.startTrackpad - with a finger on the trackpad. The strokes, ink and pen live in the controller.
PdfSignaturePadController
The strokes, ink and pen of a PdfSignaturePad, and its trackpad mode.
PdfSignaturePreview
Small ink preview used by the signature library.
PdfSignatureRequest
What PdfEditorPresenter.signature asks for.
PdfSignatureTrustAction
An action the signature panel can offer for an intact signature whose signer isn't trusted (see PdfEditingController.signatureTrustAction). label and explanation take a context so the host can localize them.
PdfSnapshot
A region of a page captured by the Snapshot tool (PdfEditTool.snapshot)
PdfSnapshotClipboard
A clipboard for the Snapshot tool's captured vector region, shared across documents: capture a region in one PdfEditingController, then paste it back as sharp vector graphics into the same document - or into a different open document tab, since every controller shares the process-wide instance by default.
PdfSourceLoadOptions
Tuning knobs for openCosDocumentFromSource. The defaults suit HTTP Range loading: a few KB probes for the header, ~64 KB windows for the tail and each xref section, and coalescing of nearby object ranges so densely packed bodies fetch in one request instead of thousands.
PdfSplitRangesRequest
What PdfEditorPresenter.splitRanges asks for.
PdfSplitter
Splits PDF bytes into standalone PDFs without file-system dependencies.
PdfStampEditorDialog
The stamp creation dialog behind showPdfStampEditor: caption field, color choice, and a live preview matching the placed appearance.
PdfStampPickerDialog
The stamp picker dialog behind showPdfStampPicker.
PdfStampPreview
Renders a stamp the way it will look on the page: bold caption inside a rounded border, both in the stamp's color.
PdfStampTemplate
Editable vector template for a reusable rubber stamp.
PdfStampTemplateComponent
PdfStandardFontChoice
A standard (base-14) family; the menu keeps the current bold/italic.
PdfStripDetail
One combined deep-zoom worker result.
PdfStripRasterTiming
Phase attribution for one strip-region raster. Allocated only while the opt-in performance log is enabled, so ordinary rendering pays no cost.
PdfStyledTextEdit
The result of the styled-text editor (showPdfStyledTextPrompt): the new text plus the style overrides to apply to it.
PdfStyledTextRequest
What PdfEditorPresenter.styledText asks for.
PdfTakeoffPanel
A compact takeoff register: the per-tool running totals over the live document, one row per measurement group (bucketed by /Takeoff label), with its kind, item count, and accumulated real-world total.
PdfTextMenuItem
One host entry in the text-selection context menu. The stock entries (markup, Copy, Select all) are built internally and always come first.
PdfTextMenuRequest
What a text-selection context menu acts on: the editing session (null in a plain reader), the page the menu opened on, and the text selection as it stood the moment the menu opened.
PdfTextRequest
What PdfEditorPresenter.text asks for.
PdfThumbnailDropController
Bridges the host's native file drag-and-drop (desktop_drop, the web's drop events, …) to the thumbnail panels, so a PDF dragged in from the desktop can be dropped at a chosen position in the page order instead of only being appended.
PdfThumbnailSidebar
A panel of page thumbnails: tap one to jump there, drag a tile up or down to reorder pages (with a mouse just drag; on touch, long-press first so the list still scrolls), the per-tile button deletes a page (the last remaining page cannot be deleted), and the strip's footer appends a blank page. Right-clicking a tile (secondary tap) opens a page context menu - rotate, duplicate, copy/cut/paste (a shared page clipboard, so pages copied here paste into a different document tab), insert a blank page before or after, export (when onExportPages is given), delete - that acts on the strip's selection when the tile belongs to it. Copy/cut/paste are also bound to ⌘/Ctrl+C/X/V, and Delete/Backspace removes the strip's selection (or the keyboard/current page when nothing is selected). All of this (export aside) needs allowPageEditing.
PdfThumbnailView
A dedicated, full-area page thumbnail grid - the same page controls as PdfThumbnailSidebar (click to select a page, double-click to open it, shift/⌘-click multi-select with a bulk-action bar, per-tile rotate/delete, drag to reorder, the page-actions menu, and the Add-page footer), laid out as a reflowing grid whose tile size the header's size control changes. Use it as a page-organizer view in place of the page viewer.
PdfTile
A retained tile image plus the page-point region it covers and the bucket it belongs to. Owned by the store's cache; disposed on eviction.
PdfTileBudgetStatus
Byte-budget admission decision for one exact-bucket visible tile set.
PdfTileKey
The full cache key of a single tile.
PdfTileLayer
Draws a page's tile pyramid over its visible region.
PdfTilePageIdentity
Everything about a page's visual state that changes what a tile should contain: the page slot and its epoch/content/destructive stamps (from PdfPageRenderIntent) plus the display plan (paper color, annotations, rotation, from PdfPageRenderPlan). Two identities that compare equal may share tiles; any difference is a distinct key so stale pixels never surface.
PdfTilePersistence
Optional persistent backing for the LoD pyramid.
PdfTilePlacement
One drawImageRect a PdfTileView asks the painter to issue: src pixels of image scaled into destFraction (0..1 of the page rect).
PdfTileRasterBackend
Creates a scene-scoped renderer for deep-zoom tiles or tile slabs.
PdfTileRasterDiagnostic
Immutable, typed view of one page's latest tile-routing diagnostics.
PdfTileRasterDiagnostics
Bounded, always-on page/tile routing diagnostics for support exports.
PdfTileRasterRetryBackend
Optional asynchronous second chance after PdfTileRasterBackend.createSession conservatively declines a retained scene.
PdfTileRasterScheduling
Optional scheduling hints implemented by tile sessions with non-Canvas submission costs.
PdfTileRasterSession
Scene-lifetime resources used to rasterize many tile regions.
PdfTileRasterWarmUp
Optional idle preparation for a scene-scoped tile session.
PdfTileStore
The tile pyramid. Instantiable (tests, an isolated page) with a shared process-wide default (instance) so one budget spans every page, replacing the unbudgeted per-page detail patch and image retention.
PdfTileView
The synchronous result of PdfTileStore.viewFor: the tiles to composite for the requested viewport right now, plus whether every visible tile was available at the exact bucket (complete = no upscaled fallback in play).
PdfTileZoomLadder
The discrete ×√2 (or ×2) pixel-ratio ladder tiles are rastered on.
PdfToolEntry
One entry in the tool catalogue: an editing tool, a text markup kind, or a host command, with the icon the dock draws for it.
PdfToolGroup
A dock group: a labelled chip that raises a contextual strip of tools.
PdfToolShortcut
A single keyboard shortcut for arming an editing tool: a trigger key, optionally "extended" with Shift.
PdfTrackpadSignatureCapture
Draws a signature with a finger on the trackpad, the way Preview does: the trackpad surface maps absolutely onto the signature pad, a finger down is the pen down, and a key press ends the capture.
PdfTrackpadSignatureEvent
One sample from a PdfTrackpadSignatureCapture. x and y place the drawing finger on the trackpad surface, 0–1 across its width and height with y down; they are meaningless for PdfTrackpadSignaturePhase.finish.
PdfUndoIntent
Undoes the last edit (⌘Z / Ctrl+Z). Editing only.
PdfViewer
A scrolling, zoomable PDF viewer.
PdfViewerController
PdfViewerTheme
Provides a PdfViewerThemeData to every dart_pdf_editor widget below it (the viewer, its scrollbars, the sidebars' scrollbars, and the editing overlay).
PdfViewerThemeData
Visual styling for PdfViewer and its companion widgets - the scrollbars, text selection and search highlights, and the editing overlay's selection chrome. Every field is optional; nulls keep the stock look. Widget-level parameters (PdfViewer.backgroundColor) win over the theme.
PdfViewModeController
The live PdfViewMode of ONE window.
PdfViewModeHolder
Read/write access to the live view mode, with notification when it changes - what the shells and their chrome bind to.
PdfViewport
A resolution-independent snapshot of a PdfViewer's scroll position and zoom - enough to reopen the same document where the user left it.
PdfViewSync
A snapshot of a viewer's scroll position and zoom, for mirroring one PdfViewer onto another - the comparison view's synchronized panes. Read PdfViewerController.viewSync, hand it to another controller's PdfViewerController.applyViewSync.
PdfWorkerRevisionDelta
The byte-level shape of one editor revision transition (an edit, undo, or redo), consumed by the shell to feed the render worker's incremental in-place update instead of restarting it. See PdfEditingController.lastRevisionDelta.
SecureFormSecretStore
A PdfFormSecretStore backed by the platform Keychain/Keystore via flutter_secure_storage. Each document's values are one JSON object under '$keyPrefix$documentId', and an index of document ids is kept under a reserved key so clearAll can find them.
SecureIdentityStore
A PdfIdentityStore backed by the platform Keychain/Keystore via flutter_secure_storage, so the private key never lands in plaintext preferences. Each identity's PEM is stored under '$keyPrefix$id', and an index of ids is kept under a reserved key so ids can enumerate them.

Enums

PdfActionBarKind
Which floating action bar a PdfActionBarRequest draws.
PdfBundledSubstitute
A bundled face family standing in for a group of unembedded PDF fonts.
PdfColorFormat
The value-entry formats PdfColorPicker can show: hex (the default), RGB (0–255), HSL (degrees and percentages), and CMYK (percentages - a naive device conversion for entry and display; the committed color is still RGB, no color management is applied).
PdfCommandCategory
Which part of the editor a PdfCommand belongs to - what a command palette shows as its source and what a host filters on.
PdfComparisonMode
How a PdfComparisonView presents the two documents.
PdfContextMenuTarget
What a context menu request acts on - resolved by the viewer before the gesture is handed to the host, so the host never has to re-run a hit test.
PdfDiffChangeKind
What a PdfDiffChange is.
PdfDiffStyle
How a diff map colors its pixels.
PdfDockablePanel
The panels a shell can rearrange between docks. Doubles as the payload dragged from a move handle onto a drop zone and the identity a shell maps to the panel's persisted PdfPanelDock.
PdfEditingInteractionEffect
Last externally relevant effect produced by a transition.
PdfEditingInteractionIntent
The gesture intent currently owned by an editing page.
PdfEditingInteractionPhase
Lifecycle of the current interaction.
PdfEditTool
The annotation tools a PdfEditingController can arm.
PdfEditToolGroup
A tool type - one dock group in PdfEditingToolbar. Pass a subset to PdfEditingToolbar.groups (or PdfEditorFeatures.toolGroups) to hide whole groups: e.g. {PdfEditToolGroup.select, PdfEditToolGroup.markup} shows only the Select and Markup groups.
PdfFormFieldKind
The field kinds the form tool can create (and convert fields to) - every PdfFieldType with creation support in PdfEditor.
PdfInsertAnchor
The page the PdfInsertSide is relative to.
PdfInsertSide
Which side of the PdfInsertAnchor page the inserted pages go.
PdfLineStyle
The border line style for shape and line annotations: solid, or one of a few dash patterns. Maps to a PDF /BS /D dash array scaled to the pen width; PdfAnnotation.borderDash reads the array back.
PdfMarkupKind
Text-markup tools for PdfEditingController.markupTool and PdfEditingController.addMarkup.
PdfMeasurementInputKind
Which number a PdfMeasurementInputRequest asks for.
PdfNoticeKind
What a PdfEditorNotice is about.
PdfNoticePlacement
Where the stock presenter puts a notice. Custom presenters may ignore it.
PdfPagePairKind
How two documents' pages line up.
PdfPagePreviewLod
The progressive page-preview levels below the final display raster.
PdfPageRasterWarmMode
How much of a document the viewer rasterizes ahead of navigation while it is genuinely idle.
PdfPageReconciliationMode
How the viewer reconciled its page presentation across a document change.
PdfPanelDock
Which edge of the content area a dockable panel is attached to.
PdfPencilTapAction
The double-tap action the user selected in iOS Settings → Apple Pencil, reported by UIPencilInteraction.preferredTapAction. The native side forwards it with every gesture so the Dart policy - not the runner - decides what to do, honoring the user's choice (notably ignore, when they turn the gesture off).
PdfPerformancePlatform
Coarse runtime family used by the adaptive render policy.
PdfPerformanceTier
The current auto-policy posture. Exposed in diagnostics and tests.
PdfRasterDiskFormat
Serialized representation of a full-resolution page raster on disk.
PdfRasterFormat
The raster encodings PdfPageExport can produce.
PdfReadoutKind
Which floating readout a PdfReadoutRequest draws.
PdfRenderDeviceMode
Which device family PdfPageRenderer.renderImageWithPlan paints with.
PdfRenderMotionClass
Paces the first interpretation of PDF pages so a single frame never runs more than one synchronous content-stream walk.
PdfSidebarSide
Which side of the viewer a sidebar panel's resize grip belongs to. Its grip rides the opposite (inner) edge - the one facing the viewer. Kept as the horizontal-only orientation the grip and the comparison navigator still speak; new placement code uses PdfPanelDock.
PdfSignatureIdentityError
Why PdfDigitalSignatureIdentity.fromFiles rejected the chosen files.
PdfStampDateFormat
Date formats used by the built-in {{date}} and {{datetime}} stamp template fields.
PdfStampTemplateComponentType
PdfStampTimeFormat
Time formats used by the built-in {{time}} and {{datetime}} stamp template fields.
PdfStandardFont
The standard one-byte fonts the editors write text with - the bold, italic, and bold-italic variants of a sans-serif, serif, and monospace pick from the PDF base-14 set, which every viewer renders without embedding.
PdfStandardFontFamily
The three base-14 type families the editors write text with - a sans-serif, serif, and monospace pick that every viewer renders without embedding. The bold/italic variants of each are individual PdfStandardFont values; this is the axis the UI's family picker selects, orthogonal to the bold/italic toggles.
PdfThemePreference
The app theme a host runs the editor UI in, as the user chose it: follow the platform's brightness, or force light or dark. Persisted by PdfEditingPreferences.themePreference.
PdfThumbnailDropEdge
Which edge of a page tile an insertion marker hugs. The docked strip stacks tiles vertically (top/bottom); the page grid flows them along the reading direction (left/right).
PdfTileRasterRoute
How a page's deep-zoom detail tiles are currently rasterized.
PdfTrackpadSignaturePhase
What a PdfTrackpadSignatureEvent reports.
PdfViewerFit
How PdfViewer zooms the document when it first appears.
PdfViewMode
Which surface owns the document area: fixed-layout pages, the inferred text reflow view, or the full-area page grid. Exactly one at a time - see PdfEditingPreferences.viewMode.

Extensions

PdfOcrApply on PdfEditor
Running an PdfOcrEngine and writing its result onto a page.

Constants

defaultPdfRenderWorkerCacheBudgetBytes → const int
Default decoded-image command-buffer cache budget for one render worker.
defaultPdfRenderWorkerCacheMaxEntries → const int
Default maximum number of records the caching worker retains.
defaultPdfRenderWorkerCacheMaxRetainedCommands → const int
Default maximum number of command slots retained by the main-side render record cache.
defaultPdfRenderWorkerPoolSize → const int
Default number of platform workers PdfRenderWorker.start fans page records across.
defaultPdfRenderWorkerScriptUrl → const String
The package-asset URL of the Web Worker script shipped in the optional dart_pdf_editor_assets package.
defaultPdfViewerPageObjectCacheMaxEntries → const int
Default maximum number of per-page objects the viewer keeps in each of its page-keyed object caches (extracted text, annotation lists, form-field rects).
defaultStyledTextPalette → const List<Color>
The quick-pick colours the styled-text dialog offers by default - the same set the toolbar uses. Overridden by the host's own palette when the toolbar opens the dialog.
kPdfDiffChannelTolerance → const int
Default per-channel difference treated as identical, matching the Ghent/PDF.js harnesses.
kPdfLegacyMaterialBridge → const bool
Whether the legacy-host bridge is compiled in: true unless the app is built with --dart-define=PDF_LEGACY_MATERIAL_BRIDGE=false.
pdfAdventorFontFamily → const String
The open metric-compatible face used for unembedded Century Gothic and Avant Garde text.
pdfBundledAdventorFontFamily → const String
Flutter's package-qualified name for the optional bundled Adventor face.
pdfCarlitoFontFamily → const String
The open metric-compatible face used for unembedded Calibri text.
pdfCursorFontFamily → const String
The open metric-compatible face used for unembedded Courier text.
pdfEditToolShortcuts → const Map<PdfEditTool, PdfToolShortcut>
Default keyboard shortcuts for arming the editing tools.
pdfHerosFontFamily → const String
The open metric-compatible face used for unembedded Helvetica / Arial text.
pdfRenderWorkerPoolMinPages → const int
Documents with at least this many pages use a PdfPooledRenderWorker via startPdfRenderWorker; shorter ones use a single worker because extra startup and memory usually cost more than the parallelism saves.
pdfSearchFieldBorderRadius → const BorderRadius
The corner radius shared by search inputs across the viewer and app: a stadium. A deliberately oversized radius keeps the ends fully rounded at every supported field height.
pdfShellCompactWidth → const double
Below this width the stock shells go compact: side panels become bottom sheets, the header's trailing controls collapse into a Controls sheet, and the editing toolbar docks below the viewer as a solid bar. Override it per editor with PdfEditorThemeData.compactWidth.
pdfTermesFontFamily → const String
The open metric-compatible face used for unembedded Times text.
pdfToolGroups → const List<PdfToolGroup>
The seven dock groups, in order. The toolbar filters this by its own tools/showMarkup settings before display.

Properties

detectedPdfPerformancePlatform → PdfPerformancePlatform
The current runtime family, however the platform will admit to it.
no setter
pdfBundledFonts ↔ List<PdfBundledFont>
The fonts offered in every font menu without a file picker, on top of the base-14 families, the document's own fonts, and the platform fonts.
getter/setter pair
pdfDebugGestureLog ↔ void Function(String message)?
Sink for the viewer's touch/gesture diagnostics. Null (the default) means the viewer emits nothing and pays only a single null-check at each gesture decision point. A host's developer tools sets it to capture which pan/zoom path a touch actually took - the signal for "panning does nothing while zoomed" reports that never reproduce off-device. Set back to null to stop.
getter/setter pair
pdfDebugPaintDetailBounds → ValueNotifier<bool>
Paints diagnostic borders on the deep-zoom detail surfaces: every tile placement in a PdfTileLayer (green for exact-bucket tiles, orange for upscaled coarser fallbacks) and the legacy single detail patch (purple). Shows what sharpens the visible slice, and from which source.
final
pdfDebugShowGpuRasterRoutes → ValueNotifier<bool>
Shows each page's exact deep-zoom tile route.
final
pdfDebugShowRenderWindow → ValueNotifier<bool>
Outlines, in the thumbnail strip/grid, the pages that currently hold a live page-view state (PdfLivePageRegistry) - the lazy-list "render window" whose retained scenes and rasters dominate per-page memory.
final
pdfPlatformFonts ↔ List<PdfPlatformFont>
Platform (OS-installed) fonts offered in every font menu, on top of the base-14 families and the pdfBundledFonts. The editor library can't enumerate the host's fonts, so a host app fills this once at startup (see the example/app's loadPlatformFonts) and every showPdfFontMenu picks it up by default. Empty until a host populates it.
getter/setter pair
pdfRenderWorkerCacheBudgetBytes ↔ int
Decoded-image command-buffer cache budget for each render worker.
getter/setter pair
pdfRenderWorkerCacheMaxEntries ↔ int
Maximum number of records the caching worker retains, regardless of weight.
getter/setter pair
pdfRenderWorkerCacheMaxRetainedCommands ↔ int
Maximum number of command slots retained by the main-side render cache.
getter/setter pair
pdfRenderWorkerPoolSize ↔ int
How many platform workers PdfRenderWorker.start fans page records across.
getter/setter pair
pdfRenderWorkerRecordTimeout ↔ Duration
How long the caching worker waits for one backend record before giving up on that worker snapshot.
getter/setter pair
pdfRenderWorkerReuseTranscripts ↔ bool
Whether newly-created web render workers reuse one image-free page transcript across progressive record, image, detail, and strip phases.
getter/setter pair
pdfRenderWorkerScriptUrl ↔ String?
On web, the URL of the compiled Web Worker script that backs the render worker (its main() calls runPdfRenderWorker; see the web-only library package:dart_pdf_editor/render_worker_web.dart and doc/render_worker_web.md for the build wiring).
getter/setter pair
pdfViewerDefaultShortcuts → Map<ShortcutActivator, Intent>
The viewer's stock key bindings (PdfViewer.shortcuts defaults to these). Every intent is listed for both ⌘ (macOS, iOS) and Ctrl. The editing ones do nothing - and let the key through - without an editing session; the tool keys (PdfViewer.toolShortcuts) are bound on top.
final
pdfViewerPageObjectCacheMaxEntries ↔ int
Maximum number of per-page objects the viewer retains in each page-keyed object cache, regardless of size. See PdfPageObjectCache.
getter/setter pair

Functions

encodePageForVectorPrinting(PdfPage page, {int? rotation, bool annotations = true}) → Future<Uint8List>
Encodes page as a vector-print op stream (see encodeVectorPrintPage) using the app's full dart:ui-backed image decode, so baseline-JPEG underlays - the one image class the pure-Dart path can't turn into pixels - still reach the print stream.
loadBundledFont(PdfBundledFont font) → Future<Uint8List>
Loads (and caches) a bundled font's bytes, from its PdfBundledFont.loadBytes when set, otherwise from the asset bundle key.
loadFallbackFonts() → Future<List<PdfEmbeddedFont>>
The bundled DejaVu trio (sans, serif, monospace) parsed for use as content-edit fallbacks: when rewriting composite (/Type0) page text, a document's own font may be subsetted and lack the glyph for a character the user types, so these wide-Unicode faces draw it instead (the closest serif/mono match is chosen). Loaded and cached once; a missing/corrupt asset is skipped. Returns an empty list when pdfBundledFonts carries no DejaVu faces (a viewer that didn't register dart_pdf_editor_assets), which just disables composite-text fallback rather than failing.
lookupDartPdfEditorLocalizations(Locale locale) → DartPdfEditorLocalizations
pdfAnnotationMenuEntry(PdfAnnotationMenuItem item) → PdfMenuItem<PdfAnnotationMenuItem>
A row for an annotation or form-field context menu, drawn like the stock rows (dense, a 16px icon) - for PdfAnnotationMenuEntriesBuilders.
pdfApplyFont(PdfEditingController controller, PdfTextFont font) → void
Applies font to controller: it becomes the font new free text is written in (an embedded font sets PdfEditingController.activeFont; a standard family sets PdfEditingController.fontFamily) and restyles every selected free-text box too. Other selected annotation subtypes are ignored.
pdfBundledSubstituteFor(String? fontName) → PdfBundledSubstitute
The bundled face that stands in for fontName.
pdfCanvas2dSubstituteFamily(String? fontName) → String
Canvas2D font-family value for substituted fontName.
pdfDefaultImageCacheBytes({PdfPerformancePlatform? platform, double? deviceMemoryGb}) → int
The default byte budget for the process-wide decoded-image cache (PdfImageCache) on this platform.
pdfDefaultLiveRasterBudgetBytes({PdfPerformancePlatform? platform, double? deviceMemoryGb}) → int
Platform-aware default for PdfLiveRasterBudget.maxBytes: the ceiling over the base rasters, detail patches, and retained-scene images the live pages in the scroll cacheExtent hold at once (#405).
pdfDefaultMeasurementUnit([Locale? locale]) → String
The default real-world distance unit for locale: feet in the imperial-system regions (the US, Liberia, Myanmar), metres everywhere else. The scale dialog passes no argument, so it follows the device region a user expects rather than the app's (possibly English-only) UI locale.
pdfDefaultPageUnit([Locale? locale]) → String
The default on-page reference unit (the ratio's left-hand side) for locale: inches in the imperial-system regions, centimetres everywhere else. Like pdfDefaultMeasurementUnit, this follows the device region.
pdfDefaultRetainedSceneBytes({PdfPerformancePlatform? platform}) → int
The default byte budget for retained page scenes (PdfPagePreviewCache's retained-scene LRU) on this platform.
pdfDefaultTileBudgetBytes({PdfPerformancePlatform? platform}) → int
The default byte budget for the process-wide deep-zoom tile pyramid (PdfTileStore) on this platform.
pdfDefaultTileStoreDetail() → bool
Whether the deep-zoom tile pyramid (PdfPageView.tileStoreDetail, issue #314) is on by default. On for every platform since the budget-vs-demand guard (issues #314/#360) removed the eviction thrash a HiDPI/web view could hit: a view too dense to tile within budget now falls back to the single detail patch instead of re-rastering evicted tiles on every repaint (PdfTileStore.viewFitsBudget).
pdfDefaultWorkerImageCacheBytes({PdfPerformancePlatform? platform, double? deviceMemoryGb}) → int
Platform-aware budget for each render worker's own decoded-image cache (the PdfImageDecodeCache a worker keeps per open document so a page recorded again - vector-first, full, thumbnail, deep-zoom detail - does not decode its images again, #451).
pdfDocumentKey(Uint8List bytes) → String
A stable key identifying a PDF by its content, for persisting a per-document viewport (see PdfReader.documentId).
pdfEditToolGroupOf(PdfEditTool tool) → PdfEditToolGroup
The dock group tool belongs to. Mirrors the layout of PdfEditingToolbar so surfaces that list tools - the keyboard-shortcuts editor in particular - can organise them the same way the toolbar reads.
pdfEditToolLabel(BuildContext context, PdfEditTool tool) → String
The bare, localized name of tool. The enum is the key.
pdfEditToolShortcutLabel(PdfEditTool tool, {Map<PdfEditTool, PdfToolShortcut> shortcuts = pdfEditToolShortcuts}) → String?
The display label for tool's shortcut key (e.g. 'V' or '⇧L'), or null when the tool has no bound key.
pdfEditToolTooltip(BuildContext context, PdfEditTool tool) → String
The full tooltip for tool. Tools whose tip is just their name fall through to pdfEditToolLabel; the rest carry a fuller how-to hint.
pdfEditToolTooltipWithShortcut(BuildContext context, PdfEditTool tool, {Map<PdfEditTool, PdfToolShortcut> shortcuts = pdfEditToolShortcuts}) → String
tooltip with the tool's keyboard shortcut appended (e.g. "Rectangle (R)"), so the bindings in pdfEditToolShortcuts are discoverable on hover. Unbound tools keep the plain tip.
pdfFloatingToastMargin(BuildContext context, {double pill = 360}) → EdgeInsetsGeometry
Margin that floats a SnackBar clear of the editor's bottom chrome - the floating editing toolbar dock (and any device safe-area inset beneath it, e.g. a home indicator). Use it with SnackBarBehavior.floating so toasts never hide behind the dock:
pdfFormSecretDocumentId(Uint8List permanentId) → String
The PdfFormSecretStore key for a document whose permanent identifier (pdfPermanentDocumentId in pdf_document) is permanentId: lowercase hex.
pdfGpuSoftMaskOf(Image image) → Image?
pdfImageContentKey(PdfImageRequest request) → Object
Identifies request's source image irrespective of the resolution anything decoded it at: stream identity for an XObject, a value key for an inline image (whose stream is synthesized fresh on every interpretation pass).
pdfInsertIndex({required int pageCount, required PdfInsertSide side, required PdfInsertAnchor anchor, int page = 1}) → int
The insertion index for side of anchor in a pageCount-page document; page (one-based) is used for PdfInsertAnchor.page.
pdfInsertPagesInteractively(BuildContext context, {required PdfEditingController controller, required PdfPickInsertFiles pickFiles, List<PdfInsertFile> initialFiles = const [], int currentPage = 0}) → Future<({int files, List<int> pages})?>
Picks files (unless initialFiles are given), shows showPdfInsertPagesDialog, and commits the result to controller as one undoable edit. Returns how many files contributed pages and the inserted pages' indices, or null when the user cancelled or nothing was inserted.
pdfL10n(BuildContext context) → DartPdfEditorLocalizations
Resolves the editor UI's localizations for context, falling back to English when the host app hasn't registered DartPdfEditorLocalizations.delegate - package widgets therefore work out of the box, and hosts opt into translations by adding DartPdfEditorLocalizations.localizationsDelegates to their app.
pdfLogGesture(String message, [String details()?]) → void
Emits message through pdfDebugGestureLog when a host has installed one. details is appended lazily so its (possibly non-trivial) string only builds when logging is live.
pdfMarkupLabel(BuildContext context, PdfMarkupKind markup) → String
The bare, localized name of a text-markup kind.
pdfMarkupTooltip(BuildContext context, PdfMarkupKind markup) → String
The full tooltip for a text-markup kind.
pdfPanelControlsRevealOnHover() → bool
Whether panel row controls should be revealed by mouse hover.
pdfPredictStrokeLead(List<(double, double)> points, {int steps = 1, double gain = 0.9, double curvatureDamping = 0.5, double minSegment = 0.75, double maxLeadFactor = 1.6, double maxTurn = 2.0}) → List<(double, double)>
Forward-extrapolates a short speculative "lead" beyond the last sampled point of an in-progress ink stroke, to mask the input+render latency between the pen tip and the painted line - the pure-geometry analogue of PencilKit's predicted touches (which read the OS's hardware predictor). Display only: the returned points are drawn ahead of the stroke but never enter the committed /InkList.
pdfPresentLinkPrompt(BuildContext context, {required int pageCount, required int currentPage, String initialUrl = ''}) → Future<PdfLinkTarget?>
A PdfLinkPrompt that asks the nearest PdfEditorPresenter.
pdfPresentStyledTextPrompt(BuildContext context, {required String initial, List<Color> palette = defaultStyledTextPalette, PdfStyledFontPicker? pickFont}) → Future<PdfStyledTextEdit?>
A PdfStyledTextPrompt that asks the nearest PdfEditorPresenter.
pdfPresentTextPrompt(BuildContext context, {required String title, String initial = '', bool multiline = false}) → Future<String?>
A PdfTextPrompt that asks the nearest PdfEditorPresenter - the default wherever the editor takes a text prompt.
pdfRenderCommandBounds(PdfRenderCommand command) → PdfRect?
pdfRenderPathBounds(PdfPath path) → PdfRect?
pdfResolveStampTemplateText(String text, Map<String, String> values) → String
Resolves {{field}} placeholders in stamp text from values.
pdfShouldWarmThumbnails(int pageCount, {bool? web}) → bool
Whole-document thumbnail warming policy.
pdfSubstituteIsBold(String? fontName) → bool
Whether a run in fontName draws in a bold weight.
pdfSubstituteIsItalic(String? fontName) → bool
Whether a run in fontName draws slanted.
pdfTextContextMenu(BuildContext context, EditableTextState editableTextState) → Widget
The context menu builder every editor text field uses: the platform's stock menu (the system menu where the field supports it, else the adaptive Material/Cupertino toolbar), with the localizations and theme it needs re-injected. The menu is built in the root overlay, outside the editor's subtree, so a host without Material localizations would otherwise get an error widget on right-click or long-press.
pdfTextMenuEntry(PdfTextMenuItem item) → PdfMenuItem<PdfTextMenuItem>
A row for the text-selection context menu, drawn like the stock rows - for PdfTextMenuEntriesBuilders.
pdfThumbnailDropIndexAt({required BuildContext? panelContext, required Map<int, GlobalKey<State<StatefulWidget>>> tileKeys, required int pageCount, required Axis axis, required Offset globalPosition, bool reversed = false}) → int?
The insertion index a drop at globalPosition lands on for a panel whose tiles are laid out along axis, or null when the point is outside the panel.
pdfToolCatalog({Set<PdfEditTool>? tools, bool markup = true}) → List<({PdfToolEntry entry, PdfToolGroup group})>
Every catalogue entry, flattened, paired with the group it belongs to - what a command palette or a shortcut sheet enumerates.
pdfUsesAdventorSubstitute(String? fontName) → bool
Whether fontName belongs to the Century Gothic / Avant Garde metric family.
rasterizePdfForPrinting(PdfDocument document, {double dpi = 200, int jpegQuality = 85}) → Future<Uint8List>
Flattens document into a fresh, image-only PDF: every page is rendered to a bitmap with this package's own engine and re-emitted as a single full-page JPEG.
rasterizeThumbnail({required PdfEditingController controller, required int pageIndex, required Color pageColor, required bool annotations, Set<String> hiddenAnnotationSubtypes = const {}, required int pixelWidth, required PdfRenderWorker? worker, int priority = 2, bool skipIfWorkerDeclines = false, bool deferUiWork()?, String reason = 'tile', PdfRasterCache? disk, PdfPagePreviewCache? previews, bool? allowSoftPreview}) → Future<Image?>
Interprets pageIndex and rasterizes it to a tile-resolution image, off the UI thread via worker when one is active and locally otherwise. Returns null when the page has no area or can't be rendered.
readSourceFully(PdfByteSource source, {void onProgress(int received, int? total)?, int chunk = 8 << 20, PdfCancelToken? cancelToken}) → Future<Uint8List>
Reads a whole PdfByteSource into one contiguous buffer, reporting progress as it goes.
showCreateSigningIdentityDialog(BuildContext context, {PdfIdentityStore? store, String? storeId}) → Future<PdfSigningIdentity?>
Shows the "Create signing identity" dialog: the user enters a name (and optionally an email and organization), and a self-signed P-256 PdfSigningIdentity is minted offline via PdfSigningIdentity.generate.
showPdfAddLinkDialog(BuildContext context, {required int pageCount, required int currentPage, String initialUrl = ''}) → Future<PdfLinkTarget?>
The default showPdfAddLinkDialog: a small Material dialog that collects a hyperlink target - an external web address, or a page in this same document. Returns the chosen PdfLinkTarget, or null if the user cancels or leaves the field empty.
showPdfAnnotationLibrary(BuildContext context, {required PdfEditingController controller, required int pageIndex, PdfImagePicker? imagePicker, PdfStampExportCallback? onExportStamps, PdfStampImportCallback? onImportStamps}) → Future<void>
Opens the reusable annotation library.
showPdfAnnotationMenu({required BuildContext context, required Offset position, required PdfEditingController controller, required int pageIndex, PdfAnnotationMenuBuilder? customActions, PdfAnnotationMenuEntriesBuilder? entriesBuilder, PdfTextPrompt textPrompt = pdfPresentTextPrompt, VoidCallback? onPaste, (double, double)? pagePoint, (int, int)? unlockTarget}) → Future<void>
Shows the annotation context menu at position (global coordinates) for controller's current selection: copy/cut/apply-to-pages/paste, bring to front, send to back, add/remove node (a single /PolyLine or /Polygon, when pagePoint is known), delete, then whatever customActions adds. Resolves when the menu closes, after the picked action ran.
showPdfCalibrationLengthDialog(BuildContext context, {String? initialUnit}) → Future<(double, String)?>
Asks how long the just-drawn reference segment is in the real world, returning (realLength, unitLabel) or null when dismissed. Used by the draw-a-segment calibration flow after the user releases the drag. initialUnit pre-selects the unit (defaults to the device region's).
showPdfColorPicker(BuildContext context, {required Color initial, PdfColorFormat initialFormat = PdfColorFormat.hex, ValueChanged<PdfColorFormat>? onFormatChanged, List<Color> recentColors = const [], List<Color> documentColors = const [], VoidCallback? onPickFromPage}) → Future<Color?>
Shows PdfColorPicker in a dialog. Returns the chosen color, or null when dismissed.
showPdfColorProcessingDialog(BuildContext context, {required PdfEditingController controller, required PdfEditingPreferences preferences}) → Future<int?>
Shows the document color-processing dialog and returns the number of page-content color operators rewritten, or null when cancelled.
showPdfDepthDialog(BuildContext context, {String? unitLabel}) → Future<double?>
Asks for the extrusion depth of a volume measurement, in the scale's distance unit (unitLabel, shown as a suffix). Returns the depth, or null when dismissed. Used by the volume tool after the footprint polygon is drawn.
showPdfDialog<T>({required BuildContext context, required WidgetBuilder builder, bool barrierDismissible = true, Color? barrierColor, String? barrierLabel, bool useSafeArea = true, bool useRootNavigator = true, RouteSettings? routeSettings, Offset? anchorPoint, TraversalEdgeBehavior? traversalEdgeBehavior, bool fullscreenDialog = false, bool? requestFocus, AnimationStyle? animationStyle}) → Future<T?>
Shows a Material dialog inside the current Flutter view.
showPdfEditingGuidesDialog(BuildContext context, {required PdfEditingPreferences preferences}) → Future<void>
Opens the stock guide, snapping, grid, and ruler settings.
showPdfFontMenu({required BuildContext context, required PdfEditingController controller, PdfFontPicker? fontPicker, List<PdfBundledFont>? bundled, List<PdfPlatformFont>? platformFonts, List<PdfEmbeddedFont>? documentFonts, PdfTextFont? currentFont, void onSelected(PdfTextFont font)?}) → Future<void>
Pops a font menu anchored at context's widget and applies the pick: the standard families, the fonts already embedded in the open document (documentFonts, defaulting to PdfEditingController.documentFonts), the bundled fonts, the platform fonts (platformFonts, defaulting to the host-populated pdfPlatformFonts registry), then "Load font…" (when a fontPicker is given). Recently-picked fonts head the list in a "Recently used" group. The search field is focused on open and the menu is searchable. Bundled, platform, document and custom fonts embed into the document so the text renders everywhere.
showPdfFormFieldMenu({required BuildContext context, required Offset position, required PdfEditingController controller, required String fieldName, int? widgetIndex, PdfTextPrompt textPrompt = pdfPresentTextPrompt, PdfFontPicker? fontPicker, PdfFormImagePicker? formImagePicker, PdfFormFieldMenuEntriesBuilder? entriesBuilder}) → Future<void>
Shows the form tool's field context menu at position (global coordinates) for the field named fieldName: rename, convert to the other creatable kinds, delete, and flatten the whole form, rewritten by entriesBuilder when given. Resolves when the menu closes, after the picked action ran.
showPdfFormOptionsDialog({required BuildContext context, required PdfEditingController controller, required String fieldName}) → Future<bool>
Opens the options editor for the combo or list box fieldName and applies the result through PdfEditingController.setFormFieldOptions. Returns whether the field changed (false when cancelled, unchanged, or not a choice field).
showPdfInsertPagesDialog(BuildContext context, {required int pageCount, required PdfPickInsertFiles pickFiles, List<PdfInsertFile> initialFiles = const [], int currentPage = 0}) → Future<PdfInsertPagesPlan?>
The Bluebeam-style "Insert pages" dialog: several PDFs (each with its own page range, odd/even filter and reverse toggle, reorderable), the placement (before/after the first, last or a given page), interleaving, and bookmark handling. pickFiles backs "Add files…"; initialFiles start the list. currentPage (zero-based) seeds the placement as "after the current page". Returns null when cancelled.
showPdfPageRangeDialog(BuildContext context, {required int pageCount, int? initialStart, int? initialEnd, String? title, String? confirmLabel}) → Future<({int end, int start})?>
Asks the user for an inclusive page range, returning it 0-based as (start, end) - or null when cancelled. pageCount bounds the input and seeds the default span (the whole document, unless initialStart/ initialEnd narrow it). Fields are shown 1-based.
showPdfRemoveSignatureDialog(BuildContext context, PdfSignature signature) → Future<bool>
Confirms removal of an active digital signature from the document.
showPdfScaleDialog(BuildContext context, {PdfMeasurementScale? initial, VoidCallback? onCalibrate}) → Future<PdfMeasurementScale?>
Asks the user for a drawing scale (1 in on the page = N unit in the world) and returns the calibrated PdfMeasurementScale, or null when dismissed. initial pre-fills the fields. When onCalibrate is given, the dialog offers a "Calibrate" action that dismisses the dialog and invokes the callback (typically to arm the draw-a-reference-segment flow) instead of returning a typed ratio.
showPdfSignatureDialog(BuildContext context, {bool predictStrokes = true, Color? initialColor, double initialStrokeWidth = PdfInkSignature.defaultStrokeWidth, PdfSignatureColorPicker? pickColor, PdfTrackpadSignatureCapture? trackpad}) → Future<PdfInkSignature?>
Shows the signature pad dialog; resolves to the drawn signature, or null on cancel. predictStrokes forward-extrapolates the in-progress stroke to mask input latency, exactly like the ink tool (see PdfViewer.predictStrokes); display only, never committed.
showPdfSignatureLibrary(BuildContext context, {required List<PdfSavedSignature> signatures, required String? activeId, required Future<PdfSavedSignature?> onAdd(BuildContext context), required Future<PdfSavedSignature?> onRename(BuildContext context, PdfSavedSignature signature), required Future<PdfSavedSignature?> onRedraw(BuildContext context, PdfSavedSignature signature), required void onSelect(PdfSavedSignature signature), required void onDelete(PdfSavedSignature signature)}) → Future<void>
Opens the saved-signature picker. Callbacks keep storage and controller policy with the caller while this widget owns the list-management UI.
showPdfSplitDialog(BuildContext context, {required int pageCount}) → Future<List<PdfPageRange>?>
Asks for comma-separated page ranges, one output PDF per item.
showPdfStampEditor(BuildContext context, {Iterable<String> fields = PdfEditingController.stampTemplateBuiltinFields, PdfImagePicker? imagePicker, PdfCustomStamp? initial}) → Future<PdfCustomStamp?>
Shows the stamp creation dialog; resolves to the new stamp, or null on cancel. Saving it is the caller's job (the picker saves through the controller).
showPdfStampPicker(BuildContext context, {required PdfEditingController controller, PdfImagePicker? imagePicker, PdfStampExportCallback? onExportStamps, PdfStampImportCallback? onImportStamps}) → Future<void>
Shows the stamp picker: choose the stamp the stamp tool places, create a new one, or delete saved ones. Selections apply directly to controller.
showPdfStyledTextPrompt(BuildContext context, {required String initial, List<Color> palette = defaultStyledTextPalette, PdfStyledFontPicker? pickFont}) → Future<PdfStyledTextEdit?>
The default PdfStyledTextPrompt: a Material dialog that reuses the toolbar's text-box style controls - the Bold/Italic FontStyleToggles, a font-size slider, and a PdfColorSwatchRow for the fill - above a text field.
showPdfTextPrompt(BuildContext context, {required String title, String initial = '', bool multiline = false}) → Future<String?>
The default PdfTextPrompt: a one-field Material dialog.
startPdfRenderWorker(Uint8List bytes, {required int pageCount, int? workerCount, bool copySource = false, List<int>? populatedRanges, int? imageCacheBytes}) → PdfRenderWorker
Starts the right cached worker for a pageCount-page document: a pooled backend when the document is long enough and workerCount (or the global pdfRenderWorkerPoolSize fallback) asks for parallelism, otherwise a single platform worker. copySource is forwarded to PdfPooledRenderWorker; it defaults to false here because every caller of this entry point starts the worker over a document image whose bytes don't change under it (the read-only reader, or a view of the edit session's current revision, whose bytes hold until the next revision is fed in - see PdfRenderWorker.updateRevisionTo). Skipping the pool's defensive snapshot saves a full-document allocation per worker generation - the single-worker branch never copied either. populatedRanges follows PdfDocument.open's sparse-buffer contract. imageCacheBytes is each worker's decoded-image cache budget; null takes the platform default (pdfDefaultWorkerImageCacheBytes).
thumbnailKey(PdfEditingController controller, int pageIndex, Color pageColor, bool annotations, int pixelWidth, {Set<String> hiddenAnnotationSubtypes = const {}}) → String
The shared-cache key a page's thumbnail is stored under: the page's identity (its indirect reference, so a reordered page keeps its raster and the slot it left doesn't - a reorder bumps no stamps, see #1025), its render stamp (so an edit re-renders only the pages it touched), the paper color, the raster width bucket, and which annotations are drawn. The tile, the grid cell, and the background warm all derive the same key, so they reuse one another's rasters.

Typedefs

PdfActionHandler = void Function(PdfAction action, PdfAnnotation annotation)
Signature for PdfViewer.onAction: the user activated annotation (tapped a link or form button) and the viewer doesn't handle its action itself.
PdfAnnotationEditPredicate = bool Function(PdfAnnotation annotation)
Host veto over which annotations the editing UI may change - see PdfEditingController.canEditAnnotation.
PdfAnnotationMenuBuilder = List<PdfAnnotationMenuItem> Function(BuildContext context, PdfAnnotationMenuRequest request)
Builds the host's extra context-menu entries for the current selection. Returning an empty list adds nothing; the stock entries always come first, with a divider before the custom ones.
PdfAnnotationMenuEntriesBuilder = List<PdfMenuEntry<PdfAnnotationMenuItem>> Function(BuildContext context, PdfAnnotationMenuRequest request, List<PdfMenuEntry<PdfAnnotationMenuItem>> stock)
Rewrites a context menu's rows: receives the stock rows - the stock entries, then any PdfAnnotationMenuBuilder additions, with dividers - and returns the rows to show. Drop, reorder or add rows; find stock ones by PdfMenuEntry.id (pdf-annot-menu-delete, ...) and build new ones with pdfAnnotationMenuEntry:
PdfAnnotationTapHandler = void Function(PdfAnnotationTapDetails details)
Called when the user taps or clicks a visible PDF annotation.
PdfContextMenuHost = void Function(PdfContextMenuRequest request)
Fires when the host wants to render its own context menu in place of the stock annotation/text menu. See PdfContextMenuRequest.
PdfContextMenuRelay = void Function(Offset globalPosition, int pageIndex, {PdfAnnotation? annotation, required (double, double) pagePoint, int? slot, required PdfContextMenuTarget target})
The page overlay's channel back to the viewer's PdfContextMenuHost: the overlay resolved the annotation itself, the viewer adds the selection and controller and builds the PdfContextMenuRequest.
PdfEditingToolbarWidgetBuilder = Widget Function(BuildContext context, PdfEditingController controller, PdfViewerController viewerController)
Builds a custom widget inside PdfEditingToolbar.
PdfEditorPanelBuilder = Widget Function(BuildContext context, PdfSidebarPanelGeometry geometry)
Builds a host panel's content inside the frame the editor gives it - a resizable column or strip on its dock, or a bottom sheet on a compact layout (PdfSidebarPanelGeometry.bottomSheet). Use geometry the way the stock panels do: PdfSidebarPanelGeometry.moveHandle and PdfSidebarPanelGeometry.closeButton for a header row (both null in a sheet, whose own chrome has the title and close button), and the content insets for the resize grip.
PdfEditorToolbarBuilder = Widget? Function(BuildContext context, PdfEditingController controller, PdfViewerController viewerController)
Builds the editing toolbar for PdfEditorView.
PdfFontPicker = Future<Uint8List?> Function(BuildContext context)
Supplies a TrueType (.ttf) or OpenType (.otf) font file the font menu's "Load font…" entry embeds for new text — typically a file picker. Return null to cancel (PdfEditingController.setCustomFont).
PdfFormFieldMenuEntriesBuilder = List<PdfMenuEntry<PdfAnnotationMenuItem>> Function(BuildContext context, PdfFormFieldMenuRequest request, List<PdfMenuEntry<PdfAnnotationMenuItem>> stock)
PdfAnnotationMenuEntriesBuilder for the form tool's field menu. Stock ids are pdf-form-menu-* (edit, style, options, add-radio, rename, text, checkbox, button, radio, combo, list, signature, delete, flatten).
PdfFormImagePicker = Future<Uint8List?> Function(BuildContext context, PdfFormField field)
Supplies the image a tapped push-button field should be filled with
PdfHeaderBuilder = Widget Function(BuildContext context, PdfHeaderParts parts)
Builds the editor's header from the stock PdfHeaderParts (PdfEditorView.headerBuilder).
PdfImagePicker = Future<Uint8List?> Function(BuildContext context)
Supplies the image bytes the image tool (PdfEditTool.image) inserts
PdfLinkPrompt = Future<PdfLinkTarget?> Function(BuildContext context, {required int currentPage, String initialUrl, required int pageCount})
Supplies the target for a link the link tool (PdfEditTool.link) or the text-selection "Add link" action is placing. Return null to cancel. pageCount is the document's page count and currentPage the zero-based page the link is being drawn on (a sensible default for an internal jump).
PdfMoveDragPreviewCallback = void Function(PdfMoveDragPreview? preview)
PdfPageOverlayBuilder = List<Widget> Function(BuildContext context, int pageIndex, PdfPageGeometry geometry)
Signature for PdfViewer.pageOverlayBuilder: returns widgets stacked over one page. Use geometry to convert PDF coordinates to view coordinates, e.g. Positioned.fromRect(rect: geometry.toViewRect(...)).
PdfPartialRecordSink = void Function(List<PdfRenderCommand> partial)
Sink for progressive partial recordings (#564).
PdfPencilTapHandler = void Function(PdfPencilTapAction action)
Runs on every Apple Pencil double-tap, carrying the user's preferred action so a host can fully override the default eraser toggle.
PdfPickInsertFiles = Future<List<PdfInsertFile>> Function()
Asks the host for PDFs to insert (an empty list = cancelled). Needs the host for file I/O, like the single-file onPickPdfToInsert.
PdfReflowImageShareHandler = Future<void> Function(BuildContext context, Uint8List pngBytes)
Receives a figure the reader tapped in PdfReflowView, rendered as a PNG, to save or share it (typically the platform share sheet / a save dialog). With no handler the fullscreen image viewer still opens (pan and pinch to zoom) - it just omits the share action.
PdfScrollIndicatorBuilder = Widget Function(BuildContext context, PdfViewerController controller, PdfScrollMetrics metrics)
Signature for PdfViewer.scrollIndicatorBuilder: builds a custom main-axis scroll indicator (a compact page number, a draggable page scrubber, a platform-styled bar) in place of the viewer's built-in scrollbar. It fills the viewer, rebuilt whenever the scroll position, zoom, or current page changes; use PdfScrollMetrics.scrollAxis to orient it - the viewer's right edge for a vertical PdfPageLayout.verticalContinuous layout, the bottom edge for a horizontal PdfPageLayout.horizontalContinuous one.
PdfSelectedContentImageHandler = Future<void> Function(BuildContext context, PdfSelectedContentImage image)
Receives a selected content image from the Content tool — typically to save, share, or download it. Return when the host export is complete.
PdfSidebarPanelContentBuilder = Widget Function(BuildContext context, PdfSidebarPanelGeometry geometry)
PdfSignatureColorPicker = Future<Color?> Function(BuildContext context, Color initial)
Opens a full colour picker over the signature pad, seeded with the pad's current ink; resolves to the chosen colour or null when dismissed. The stock chrome wires this to pickEditingColor so the pad's picker offers the same recents and document colours as every other colour in the editor.
PdfSignaturePlacer = Future<void> Function(BuildContext context, {required int pageIndex, required PdfRect pageRect})
Receives a signature box the user drew with the Signature-box tool (PdfEditTool.signatureBox) - Acrobat/Bluebeam-style placement. The host collects an identity and appearance (reason, location, a hand-drawn mark, a logo backdrop) and cryptographically signs into pageRect on pageIndex via PdfEditingController.addKeylessSignature / addSelfSignedSignature / addDigitalSignature with a PdfSignatureAppearance(page: pageIndex, rect: pageRect, …). With no handler (PdfViewer.onPlaceSignature) the tool does nothing. pageRect is in PDF user space (points, origin bottom-left).
PdfSnapshotHandler = Future<void> Function(BuildContext context, PdfSnapshot snapshot)
Receives a region captured by the Snapshot tool (PdfEditTool.snapshot)
PdfSourceProgress = void Function(int fetched, int? total)
Reports progressive-load progress. fetched is the running total of bytes pulled from the source; total is the document length when known.
PdfStampExportCallback = Future<void> Function(BuildContext context, List<PdfCustomStamp> stamps)
Saves user-managed custom stamps somewhere outside the editor package.
PdfStampImportCallback = Future<List<PdfCustomStamp>?> Function(BuildContext context)
Loads user-managed custom stamps from somewhere outside the editor package.
PdfStyledFontPicker = Future<PdfTextFont?> Function(BuildContext context)
Opens the app's font menu and returns the chosen font (a standard family or an embedded face), or null if cancelled. Supplied by the toolbar so the styled dialog reuses the same font picker as the rest of the editor.
PdfStyledTextPrompt = Future<PdfStyledTextEdit?> Function(BuildContext context, {required String initial, List<Color> palette, PdfStyledFontPicker? pickFont})
Signature of the prompt the content tool uses to edit a text element's characters and its style at once. Returns null when the user cancels.
PdfSubstituteFace = ({String file, bool italic, int weight})
One bundled font file, with the weight and slant it registers under.
PdfSystemImagePasteProvider = Future<Uint8List?> Function(BuildContext context)
Supplies image bytes for a system clipboard paste. Return null when the clipboard does not currently carry a pasteable image. PNG and JPEG bytes are accepted (PdfEditingController.placeImage).
PdfSystemPdfPasteProvider = Future<PdfClipboardPdf?> Function(BuildContext context)
Supplies an external PDF clipboard payload for vector paste. Return null for clipboard data written by this app, so its in-app snapshot keeps its repeat-paste position and shared resources. Invoked before in-app paste; a newly copied external PDF therefore supersedes an older local copy.
PdfSystemTextPasteProvider = Future<String?> Function(BuildContext context)
Supplies plain text for a system clipboard paste, used in preference to Flutter's Clipboard when set. Return null when the clipboard carries no text. Exists mainly for the web, where Flutter's Clipboard.getData is unreliable: the host injects a reader built on the browser Async Clipboard API so ⌘V/Ctrl+V can paste text into a PdfEditTool.freeText box.
PdfTextMenuBuilder = List<PdfTextMenuItem> Function(BuildContext context, PdfTextMenuRequest request)
Builds the host's extra entries for the text-selection context menu - the PdfAnnotationMenuBuilder of the text menu. Returning an empty list adds nothing; the stock entries always come first, with a divider before the custom ones.
PdfTextMenuEntriesBuilder = List<PdfMenuEntry<PdfTextMenuItem>> Function(BuildContext context, PdfTextMenuRequest request, List<PdfMenuEntry<PdfTextMenuItem>> stock)
PdfAnnotationMenuEntriesBuilder for the text-selection context menu; build new rows with pdfTextMenuEntry. Stock ids are pdf-text-menu-* (edit, copy, markup, link, select-all), in the touch selection chip's order; markup opens the highlight, underline, strikeout and squiggly rows as a second menu, so they are not in stock.
PdfTextPrompt = Future<String?> Function(BuildContext context, {String initial, bool multiline, required String title})
Signature of the prompt the editing UI uses to ask for annotation text (free text, notes, stamps). Returns null when the user cancels.
PdfThumbnailDropResolver = int? Function(Offset globalPosition)
Resolves the insertion index a file drop at a global position would land on inside one thumbnail panel, or null when the position isn't over it.
PdfTileRasterizer = Future<Image> Function(Rect region, double pixelRatio)
Rasterizes one tile: region is the tile's bounds in page points (the y-down raster space PdfRetainedScene.rasterizeRegion takes), pixelRatio the bucket ratio. The returned image is owned by the store.
PdfToolChoice = ({PdfMarkupKind? markup, PdfEditTool? tool})
An armable tool choice: an editing tool, or a text-markup kind. Both null is Hand (plain reader) mode.
PdfUrlLauncher = Future<bool> Function(Uri uri)
Signature for PdfViewer.onLaunchUrl: open the hyperlink uri of a tapped /URI action. Returns whether it was opened - false hands the link back to PdfViewer.onAction so a custom scheme can still be dispatched there.
PdfWorkerPhaseTimings = PdfRenderTrace
Worker-side accumulator for the off-thread phases of one render job.

Exceptions / Errors

PdfHttpCancelledException
Thrown from a PdfHttpByteSource read after its PdfCancelToken fired.
PdfHttpException
Thrown when the server responds in a way the source cannot use (an error status, or a body that does not match the requested range).
PdfSignatureIdentityException
A FormatException raised while parsing signing key/certificate files, tagged with a machine-readable code so a host can localize the message.