1

I have a PDF page of n pages as input. On every m-th page, there is a area which I want to crop and save as an image.

Concrete example:

  • 500 page PDF
  • on every 10th page, I want to crop the area from point (10,10) to (110,110) and save it as a single image

I think the best solution would be a tool which could do this with just one command line call, so that there is no need for programming with iterations / passing outputs as inputs to other calls. Unfortunately, I haven't found such a tool. Any idea?

Needs to run on Linux.

halfer
  • 19,824
  • 17
  • 99
  • 186
spaudanjo
  • 764
  • 7
  • 13
  • 1
    ImageMagick can get the nth PDF page as an image (at a resolution of your choice) and you can generate the necessary commands using a scripting language. – halfer Jul 11 '14 at 15:53
  • Thanks for the hint. But I would prefer a solution which can do this in just one command line call. – spaudanjo Jul 14 '14 at 11:31
  • 1
    Try something like `convert source.pdf[10] output.jpeg` and then wrap it in a bash loop, swapping the `10` for the variable (you'll need to add in your own crop option, see the manual for that). I doubt there is anything that will do the loop part as a built-in feature. – halfer Jul 14 '14 at 18:14

0 Answers0