PdfViewerController class

Controls associated PdfViewer.

It's always your option to extend (inherit) the class to customize the PdfViewer behavior.

Please note that almost all fields and functions are not working if the controller is not associated to any PdfViewer. You can check whether the controller is associated or not by checking isReady property.

Inheritance

Constructors

PdfViewerController()

Properties

alternativeFitScale double?
The zoom ratio that fits whole the page to the view port.
no setter
centerPosition Offset
no setter
coverScale double
The zoom ratio that fits the page's smaller side (either horizontal or vertical) to the view port.
no setter
currentZoom double
no setter
document PdfDocument
Get the associated document.
no setter
documentRef PdfDocumentRef
The document reference associated to the PdfViewer.
no setter
documentSize Size
The document layout size.
no setter
hashCode int
The hash code for this object.
no setterinherited
isReady bool
Determine whether the document/pages are ready or not.
no setter
minScale double
The minimum zoom ratio allowed.
no setter
pageNumber int?
The current page number if available.
no setter
pages List<PdfPage>
Get the associated pages.
no setter
params PdfViewerParams
Get the associated PdfViewerParams parameters.
no setter
renderBox RenderBox?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value Matrix4
The current value of the object. When the value changes, the callbacks registered with addListener will be invoked.
getter/setter pairoverride-getter
viewSize Size
The view port size (The widget's client area's size)
no setter
visibleRect Rect
The area of the document layout which is visible on the view port.
no setter
widget PdfViewer
Get the associated PdfViewer widget.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object notifies its listeners.
override
calcMatrixFor(Offset position, {double? zoom}) Matrix4
calcMatrixForArea({required Rect rect, PdfPageAnchor? anchor}) Matrix4
Calculate the matrix for the specified area.
calcMatrixForDest(PdfDest? dest) Matrix4?
Calculate the matrix for the specified destination.
calcMatrixForPage({required int pageNumber, PdfPageAnchor? anchor}) Matrix4
Calculate the matrix for the page.
calcMatrixForRect(Rect rect, {double? zoomMax, double? margin}) Matrix4
calcMatrixForRectInsidePage({required int pageNumber, required PdfRect rect, PdfPageAnchor? anchor}) Matrix4
Calculate the matrix for the specified area inside the page.
calcMatrixToEnsureRectVisible(Rect rect, {double margin = 0}) Matrix4
calcRectForRectInsidePage({required int pageNumber, required PdfRect rect}) Rect
Calculate the rectangle for the specified area inside the page.
documentToGlobal(Offset document) Offset?
Converts the local position in the PDF document structure to the global position.
ensureVisible(Rect rect, {Duration duration = const Duration(milliseconds: 200), double margin = 0}) Future<void>
Ensure the specified area is visible inside the view port.
getNextZoom({bool loop = true}) double
getPreviousZoom({bool loop = true}) double
globalToDocument(Offset global) Offset?
Converts the global position to the local position in the PDF document structure.
globalToLocal(Offset global) Offset?
Converts the global position to the local position in the widget.
goTo(Matrix4? destination, {Duration duration = const Duration(milliseconds: 200)}) Future<void>
Go to the specified position by the matrix.
goToArea({required Rect rect, PdfPageAnchor? anchor, Duration duration = const Duration(milliseconds: 200)}) Future<void>
Go to the specified area.
goToDest(PdfDest? dest, {Duration duration = const Duration(milliseconds: 200)}) Future<bool>
Go to the specified destination.
goToPage({required int pageNumber, PdfPageAnchor? anchor, Duration duration = const Duration(milliseconds: 200)}) Future<void>
Go to the specified page.
goToRectInsidePage({required int pageNumber, required PdfRect rect, PdfPageAnchor? anchor, Duration duration = const Duration(milliseconds: 200)}) Future<void>
Go to the specified area inside the page.
handlePointerSignalEvent(PointerSignalEvent event) → void
Provided to workaround certain widgets eating wheel events. Use with Listener.onPointerSignal.
invalidate() → void
localToGlobal(Offset local) Offset?
Converts the local position to the global position in the widget.
makeMatrixInSafeRange(Matrix4 newValue) Matrix4
Restrict matrix to the safe range.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyFirstChange(void onFirstChange()) → void
relayout() → void
Forcibly relayout the pages.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies.
override
setCurrentPageNumber(int pageNumber) → void
Set the current page number.
setZoom(Offset position, double zoom) Future<void>
toString() String
A string representation of this object.
inherited
zoomDown({bool loop = false, Offset? zoomCenter}) Future<void>
zoomUp({bool loop = false, Offset? zoomCenter}) Future<void>

Operators

operator ==(Object other) bool
The equality operator.
inherited