title: Add margin and crop marks to existing PDF
body: <p>In order to prepare PDF files for printing, I'm looking for a commandline/programmatic way to modify existing PDF files and do the following:
  - add a white 3mm margin to each side of each page (so the new PDF will become 6mm larger in width and 6mm larger in height)
  - add crop marks on each page</p>
  
  <p>Here are a few commands I experimented with:</p>
  
  <p>I first tried to add a BleedBox, but that didn't have the desired effect as it didn't resize the pdf:</p>
  
  <pre><code>gs -sDEVICE=pdfwrite -o out.pdf -c "[/BleedBox[54 54 1314 810] /PAGES pdfmark" -f in.pdf
  </code></pre>
  
  <p>The following ghostscript command enlarges the pdf and adds a white margin at the top and right of each page, but the content is not centered:</p>
  
  <pre><code>gs -sDEVICE=pdfwrite -o out.pdf -r300x300 -g3000x3000 -f in.pdf
  </code></pre>
  
  <p>I also tried to resize the pdf with imagemagick, but the following command also scaled the content of the pdf:</p>
  
  <pre><code>convert -density 300 -colorspace RGB -quality 100 -border 200x200 in.pdf out.pdf
  </code></pre>
  
  <p>So far, I haven't found any way to add the crop marks.</p>
  
  <p>Could anyone please help me out with the margins and crop marks?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Kind regards,
  Michael</p>