highlightMode property

PdfHighlightMode get highlightMode

Gets or sets the highlight mode of the link annotation.

//Create a new Pdf document
PdfDocument document = PdfDocument();
//Create document link annotation and add to the PDF page.
document.pages.add()
  ..annotations.add(PdfDocumentLinkAnnotation(Rect.fromLTWH(10, 40, 30, 30),
      PdfDestination(document.pages.add(), Offset(10, 0)))
    ..highlightMode = PdfHighlightMode.outline);
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

PdfHighlightMode get highlightMode =>
    PdfAnnotationHelper.getHelper(this).isLoadedAnnotation
        ? _obtainHighlightMode()
        : _highlightMode;
set highlightMode (PdfHighlightMode value)

Implementation

set highlightMode(PdfHighlightMode value) {
  _highlightMode = value;
  final String mode = _getHighlightMode(_highlightMode);
  PdfAnnotationHelper.getHelper(this)
      .dictionary!
      .setName(PdfName(PdfDictionaryProperties.h), mode);
}