compact method

PdfLink compact()

Compact the link.

The method is used to compact the link to reduce memory usage. rects is typically growable and also modifiable. The method ensures that rects is unmodifiable. dest is also compacted by calling PdfDest.compact.

Implementation

PdfLink compact() {
  return PdfLink(List.unmodifiable(rects), url: url, dest: dest?.compact(), annotation: annotation);
}