Search code examples
bashshellgreppdftk

Identify PDF files which have bookmarks


I have a batch of pdf files (most of them are dissertations) in a directory. Some of them have bookmarks in the pdf which helps me to jump to topics easily. Now, I want to bookmark the rest of them.

In short, the question is how to identify pdf files which have bookmarks using shell or grep?


Solution

  • A simple script iterating over files in a directory may be all you need

    for f in /Your/Directory/Path/*.pdf; 
    do cpdf -list-bookmarks $f; 
    done