MutableEditsDraft


class MutableEditsDraft : EditsDraft


A mutable builder for creating a sequence of draft edit operations.

Summary

Public constructors

Public functions

Unit
insert(annotation: PdfAnnotation)

Enqueues a insert operation for a new PdfAnnotation.

Unit
remove(annotationId: String, pageNum: Int)

Enqueues a 'remove' operation for an existing annotation.

EditsDraft

Transforms the enqueued edits to an immutable request.

Unit
update(annotationId: String, annotation: PdfAnnotation)

Enqueues an 'update' operation for an existing annotation.

Inherited functions

From androidx.pdf.EditsDraft
open operator Boolean
equals(other: Any?)
open Int
Pair<EditsDraftEditsDraft>
splitAt(index: Int)

Splits this EditsDraft into two separate drafts at the specified index with bounds [0, index) and [index, n).

Public constructors

MutableEditsDraft

Added in 1.0.0-alpha19
MutableEditsDraft()

Public functions

insert

Added in 1.0.0-alpha19
fun insert(annotation: PdfAnnotation): Unit

Enqueues a insert operation for a new PdfAnnotation.

Parameters
annotation: PdfAnnotation

The PdfAnnotation to be created.

remove

Added in 1.0.0-alpha19
fun remove(annotationId: String, pageNum: Int): Unit

Enqueues a 'remove' operation for an existing annotation.

Parameters
annotationId: String

The id of the annotation to be removed.

pageNum: Int

The page number where the annotation is located.

toEditsDraft

Added in 1.0.0-alpha19
fun toEditsDraft(): EditsDraft

Transforms the enqueued edits to an immutable request.

Returns
EditsDraft

An EditsDraft containing the accumulated operations.

update

Added in 1.0.0-alpha19
fun update(annotationId: String, annotation: PdfAnnotation): Unit

Enqueues an 'update' operation for an existing annotation.

Parameters
annotationId: String

The id of the annotation to be updated.

annotation: PdfAnnotation

The new PdfAnnotation data for the update.