Merge PDF's with PDFTK with Bookmarks?

前端 未结 11 969
遥遥无期
遥遥无期 2020-12-04 08:51

Using pdftk to merge multiple pdf\'s is working well. However, any easy way to make a bookmark for each pdf merged?

I don\'t see anything on the pdftk docs regardin

11条回答
  •  北海茫月
    2020-12-04 09:25

    I know there are other ways to do this already mentioned, but with pdftk you can take the merged pdf and add bookmarks to it by using the pdftk function dump_data to create a .info file of the existing info in the pdf. Then you can add bookmark info to the .info file by add the following four lines for each bookmark

    BookmarkBegin
    BookmarkTitle: name
    BookmarkLevel: level
    BookmarkPageNumber: page number
    

    Then use the update_info call to update the merged pdf bookmarks with the ones you wrote to the .info file. I have written some simple functions that do this for me in autohotkey if anyone is interested. See http://www.autohotkey.com/board/topic/98985-scripts-to-merge-pdfs-and-add-bookmarks-with-pdftk/

提交回复
热议问题