Wraps FPDFPage_CreateAnnot + (optionally) FPDFAnnot_SetRect.
PDFium supports creating annotations of subtype "circle",
"fileattachment", "freetext", "highlight", "ink",
"link", "popup", "square", "squiggly", "stamp",
"strikeout", "text", and "underline". Other subtypes
("widget", "polygon", "line", etc.) error from PDFium.
Arguments
- page
A
pdfium_pagefrompdf_page_load(). Parent doc must be readwrite.- subtype
Character scalar — one of the supported annotation subtypes listed above.
- bounds
Optional length-4 numeric vector
c(left, bottom, right, top)in PDF user-space points. DefaultNULL(annotation has no rect set — most subtypes still need one and you'll likely follow up withpdf_annot_set_bounds()).
Details
The new annotation is appended to the page's /Annots array.
Use pdf_annotations() to re-read the page if you need an
updated handle list — the new annotation lands at the end.