A simple script written in fitz that adds highlight annotations to page margins.
Assume we have a PDF file with some highlighted text and annotations:
Run:
make_printable(Path("example.pdf"))
Input | Output |
---|---|
Customize font size and color at line 38:
annot_ = page.add_freetext_annot(
rect=note_area_rect,
text=annot.info["content"],
fontsize=12,
fontname="helv",
border_color=None,
text_color=getColor("black"),
fill_color=None,
rotate=0,
align=fitz.TEXT_ALIGN_LEFT,
)