UPdfEditController class
Edits a PDF: markups, ink, notes, text boxes, page rotate/delete/move/insert, redaction, watermark, merge, save.
- Inheritance
-
- Object
- ChangeNotifier
- UPdfEditController
Constructors
- UPdfEditController({required UPdfController viewer})
Properties
-
Author written into new annotations.
no setter
- canUndo → bool
-
True when undo is possible.
no setter
- color → Color
-
Markup color.
no setter
- edit → UPdfEdit?
-
The underlying editable document.
no setter
- fontSize → double
-
Text box font size.
no setter
- hasChanges → bool
-
True when there are unsaved changes.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- inkColor → Color
-
Pen color.
no setter
- isDrawing → bool
-
True while a pen stroke is in progress.
no setter
- opacity → double
-
Markup opacity.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strokeWidth → double
-
Pen width.
no setter
- tool → UPdfTool
-
Current tool.
no setter
- viewer → UPdfController
-
The viewer being edited.
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
addNote(
int pageIndex, Offset devicePoint, String contents) → Future< bool> - Adds a sticky note.
-
addPageNumbers(
{double fontSize = 10, int startAt = 1, bool rightAligned = true}) → Future< bool> - Adds page numbers.
-
addTextBox(
int pageIndex, Offset devicePoint, String contents, {double width = 200, double height = 60}) → Future< bool> - Adds a text box.
-
addWatermark(
String text, {double fontSize = 48, Color color = const Color(0x33000000), double rotation = 45}) → Future< bool> - Stamps text on every page.
-
allAnnotations(
) → Future< List< UPdfAnnotationInfo> > - Every annotation.
-
annotateSelection(
UDocSelection selection, UDocTextPage text) → Future< bool> - Highlights/underlines/strikes the selected text with the current tool.
-
annotationAt(
int pageIndex, Offset devicePoint) → Future< UPdfAnnotationInfo?> - Annotation under a point.
-
annotationsOn(
int pageIndex) → Future< List< UPdfAnnotationInfo> > - Annotations of one page.
-
applyPendingRedactions(
) → Future< int> - Applies every redaction mark.
-
applyRedactions(
int pageIndex, List< Rect> areas) → Future<int> - Permanently blacks out areas of a page.
-
attach(
) → void - Connects to the viewer (called by the editor page).
-
beginStroke(
int pageIndex, Offset devicePoint) → void - Starts a pen stroke.
-
deleteAnnotation(
int pageIndex, int objectNumber) → Future< bool> - Deletes an annotation.
-
deletePage(
int pageIndex) → Future< bool> - Deletes a page.
-
devicePointToPdf(
UDocPageInfo info, Offset point) → Offset - Screen point → PDF coordinates.
-
deviceRectToPdf(
UDocPageInfo info, Rect rect) → Rect - Screen rect → PDF coordinates.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
duplicatePage(
int pageIndex) → Future< bool> - Duplicates a page.
-
endStroke(
int pageIndex) → Future< void> - Finishes the stroke and saves it.
-
eraseAt(
int pageIndex, Offset devicePoint) → Future< bool> - Deletes the annotation under a point.
-
exportPages(
List< int> indices) → Future<Uint8List?> - New PDF with only some pages.
-
extendStroke(
int pageIndex, Offset devicePoint) → void - Adds a point to the stroke.
-
flatten(
{bool widgetsOnly = false}) → Future< int> - Burns annotations/form fields into the page content.
-
insertBlankPage(
int at) → Future< bool> - Inserts an empty page.
-
liveStroke(
int pageIndex) → List< Offset> - Points of the stroke being drawn on a page.
-
mergeFile(
Uint8List data) → Future< bool> - Appends another PDF.
-
movePage(
int from, int to) → Future< bool> - Moves a page.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
rotatePage(
int pageIndex, int degrees) → Future< bool> - Rotates a page by 90/180/270°.
-
saveOptimized(
String path) → Future< bool> - Saves a smaller, rewritten PDF.
-
saveTo(
String path) → Future< bool> - Saves to a file path (not on web).
-
saveToBytes(
) → Future< Uint8List?> - Saves to bytes (works on web).
-
setAuthor(
String author) → void - Sets the annotation author.
-
setColor(
Color color) → void - Sets the markup color.
-
setCrop(
int pageIndex, Rect box) → Future< bool> - Crops a page.
-
setFontSize(
double size) → void - Sets text box font size.
-
setInkColor(
Color color) → void - Sets the pen color.
-
setMetadata(
UDocMetadata metadata) → Future< bool> - Sets title, author, subject…
-
setOpacity(
double opacity) → void - Sets markup opacity.
-
setStrokeWidth(
double width) → void - Sets the pen width.
-
setTool(
UPdfTool tool) → void - Chooses the tool.
-
toString(
) → String -
A string representation of this object.
inherited
-
undo(
) → Future< void> - Undoes the last change.
-
updateAnnotation(
int pageIndex, int objectNumber, {Rect? rect, Color? color, double? opacity, String? contents}) → Future< bool> - Changes an annotation's text/color.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited