MacOS – How to crop odd and even pages differently in a PDF

macospdfpreview

I have a large PDF I want to crop/remove all the whitespace with software that runs on Mavericks

The PDF in question is designed for print; therefore, odd pages have different margins from even pages. I tried following the tip mentioned in the 3rd comment to this answer, but it seems that feature was removed from Apple's Preview app.

Any ideas? I prefer using free software but any solutions are welcome.

Best Answer

So, after some tinkering, I was able to do it using Automator. I'd be very surprised if this is the most efficient way to do it, but you only need to create the workflow once.

Basically, there's an "Extract Odd & Even Pages" action that you can use to split the file. Here's a list of the workflow:

  1. Ask for finder items.
  2. Extract odd and even pages (Odd)
  3. Move finder items (this moves the extracted PDF to a folder you specify, must be empty; otherwise, it'll be in a temporary folder that's hard to find).
  4. Ask for finder items (select the original file again; otherwise, Automator will continue processing the file created in Step 2).
  5. Extract odd and even pages (Even)
  6. Move finder items (same as 3)
  7. Ask for confirmation: Basically, it's a way to pause the workflow while you crop the pdfs. This is optional, you could just create a separate workflow (if you don't already have one) to combine the pdfs, and execute that once you're done. Otherwise, the idea is that you click "OK" after cropping both PDFs.
  8. Get folder contents/Ask for finder items: Point to the folder where the two separate PDFs are located (or select both, if you used "Ask for finder items").
  9. Combine PDF pages: Shuffle option
  10. Move finder items (wherever you want the output).

That's the general idea, there are some refinements that could be done, if not a complete 'rewrite' to make it more efficient.