https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
pdftk官方不支持arm芯片的macos(2024年),但是可以使用Homebrew安装第三方编译的Java版本(brew install pdftk-java),支持M芯片
pdftk可以用于提取和合并fdf文件,但是好像其中不包括批注(Annotation)
pdftk input.pdf generate_fdf output output.fdf pdftk form.pdf fill_form data.fdf output filled_form.pdf
man page: https://www.pdflabs.com/docs/pdftk-man-page/
以下内容来自官方的操作手册:
generate_fdf
Reads a single input PDF file and generates an FDF file suitable for fill_form. It saves this FDF file using the output filename. If no output filename is give, it outputs the FDF to stdout. Does not create a new PDF.
dump_data_annots
This operation currently reports only link annotations. Reads a single input PDF file and reports annotation information to the given output filename or (if no output is given) to stdout. Non-ASCII characters are encoded as XML numerical entities. Does not create a new PDF.
根据官方的文档,generate_fdf和dump_data_annots两种操作都不能导出Annotations(失望)