* Add a text markup annotation (internal helper).
(
subtype: "Highlight" | "Underline" | "StrikeOut" | "Squiggly",
options: TextMarkupAnnotationOptions,
)
| 2005 | * Add a text markup annotation (internal helper). |
| 2006 | */ |
| 2007 | private addTextMarkupAnnotation( |
| 2008 | subtype: "Highlight" | "Underline" | "StrikeOut" | "Squiggly", |
| 2009 | options: TextMarkupAnnotationOptions, |
| 2010 | ): PDFAnnotation { |
| 2011 | // Use the static create method on the appropriate class |
| 2012 | let annotDict: PdfDict; |
| 2013 | |
| 2014 | switch (subtype) { |
| 2015 | case "Highlight": |
| 2016 | annotDict = PDFHighlightAnnotation.create(options); |
| 2017 | break; |
| 2018 | case "Underline": |
| 2019 | annotDict = PDFUnderlineAnnotation.create(options); |
| 2020 | break; |
| 2021 | case "StrikeOut": |
| 2022 | annotDict = PDFStrikeOutAnnotation.create(options); |
| 2023 | break; |
| 2024 | case "Squiggly": |
| 2025 | annotDict = PDFSquigglyAnnotation.create(options); |
| 2026 | break; |
| 2027 | } |
| 2028 | |
| 2029 | // Register and add to page |
| 2030 | const annotRef = this.ctx.register(annotDict); |
| 2031 | this.addAnnotationRef(annotRef); |
| 2032 | |
| 2033 | return createAnnotation(annotDict, annotRef, this.ctx.registry); |
| 2034 | } |
| 2035 | |
| 2036 | /** |
| 2037 | * Add a link annotation. |
no test coverage detected