Skip to content
Advertisement

Add cut/crop marks to pdf with imagemagick

I have a pdf file which is getting generated with Inkscape from SVG and processed with ImageMagick.

Now the PDF is a perfect DINA4 @300 DPI

How can I add some marks around it?

My marks should look like this: http://cl.ly/033g3t2h0U0f/A4_crop.png

And I need to place this over the pdf with 3mm to overlap so it’s could be correctly cut. Somehow like this result: http://cl.ly/300F0A402r1D (i don’t know if this result is 3mm, is just an example)

Advertisement

Answer

ImageMagick does this easily.

composite -gravity center -density 300 src/in.pdf src/overlay.png out.pdf

This is it. Notice ghostscript is required for this, or you’ll get this error:

composite: no images defined `out.pdf' @ error/convert.c/ConvertImageCommand/3252.

I just added some checks before with identify to prove the resolution and size is right otherwise I convert the files to the right formats.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement