Sample Header Ad - 728x90

Script for copy bookmarks from one pdf to another

0 votes
1 answer
258 views
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 ';' `
Asked by fich (340 rep)
Apr 17, 2022, 01:28 PM
Last activity: Apr 18, 2022, 08:50 PM