#!/usr/bin/env python3

""" Remove annotations from a document """

import sys
import fitz 

def main(file_path: str) -> None:
    doc = fitz.open(file_path)

    for page in doc:
        annot = page.first_annot
        while annot:
            annot = page.delete_annot(annot)
    doc.save(file_path, encryption=fitz.PDF_ENCRYPT_KEEP, incremental=True)


if __name__ == "__main__":
    file_path = sys.argv[1]
    main(file_path)
