title: Create bookmarks into a PDF file via command line
body: <p>I am searching for a command line tool to add bookmarks to a PDF file. </p>
  
  <p>What I have is a <code>page number</code> and a <code>label</code>. Would love to create bookmark called <code>label</code> linking to page <code>page number</code>.</p>
  
  <p>Does any one know a command line tool (preferably OSX) for doing this? </p>
  
  <p>I have about 4000 pages PDF files and about 150 bookmarks and would love to automate it.</p>
  
  <p>My plan is to use a system call within a r-script.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I create about 4000 single PDF files with graphs and I am using the OSX system command <code>/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py</code> to join the PDFs together. Previously I was using <code>pdfjoin</code> from <code>pdfjam</code> package, but this was way too slow. In the end, this is how I get my PDF where I add the bookmarks by hand with Adobe Acrobat Professional at the moment.</p>