Skip to content

How to Deal with Annotations

Jorj X. McKie edited this page Dec 3, 2020 · 2 revisions

With PyMuPDF you can add, delete and modify most annotation types. This includes changing colors, borders, content of attached files, rotating, resizing and relocating annotations, and more.

In version 1.18.4 we have also added Popup annotation support.

Demoscript new-annots.py creates a page with all supported annotation types, which looks like so: new-annots-0.pdf.

"FreeText" annotations, by the PDF books also support a "callout" variant, with an arrow pointing to some place. This is currently not supported by us, but may be implemented in a future version.

For 'FreeText', multiple languages are now also supported, and the respective font is automatically deployed: Japanese, Chinese and Korean. See this script and its result.

Depending on the PDF viewer you use, not all languages are always visible. So best verify using the "standard" viewer Adobe Acrobat for a start.

PyMuPDF also fully supports BlendMode and setting the opacity of annotation types 'Line', 'Circle', 'Square', 'Polygon', and 'PolyLine'. Here is an example script and its result.

Clone this wiki locally