I want to transfer bookmarks from a series of uncompressed pdf files to their compressed copies (these copies do not have the original bookmarks).
I know how to do this one by one using pdftk. First I have to extract the bookmarks:
pdftk file.pdf dump_data output file.txt
and then I have to transfer them to the compressed copy:
pdftk file_mrc.pdf update_info file.txt output file_mrc_updated.pdf
(my compressed pdf files have that mrc suffix).
I have hundreds of pdf files in this situation, with the correspondent compressed pdf copy, so I want to automatize the procedure.
I found a way to extract the bookmarks from all the files with find, but I don't know how to use this command for dumping the bookmarks on the copies:
find . -type f ! -name "*mrc*" -exec pdftk '{}' dump_data output {}.txt ';'