-
Notifications
You must be signed in to change notification settings - Fork 513
How to Deal with Annotations
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.
HOWTO Button annots with JavaScript
HOWTO work with PDF embedded files
HOWTO extract text from inside rectangles
HOWTO extract text in natural reading order
HOWTO create or extract graphics
HOWTO create your own PDF Drawing
Rectangle inclusion & intersection
Metadata & bookmark maintenance