How to cut a long,long pic into multiple pages for printing?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bensto
Posts: 31
Joined: 2012-07-02T00:32:10-07:00
Authentication code: 13

How to cut a long,long pic into multiple pages for printing?

Post by bensto »

Assume I have a long,long,long picture (e.g. 1060 * 4620 pixels).

I want to print it out on physical or pdf printer.

BUT I don't want to shrink or stretch the picture or let it somehow fit on ONE page.

Instead it should be adjusted/cut so that the current WIDTH fits exactly on one page.
If the length of the picture is too big to fit on the first page then automatically additional pages should be printed.

To perform this operation I have to cut the picture into multiple chunks.
The width and height of each picture chunk should be automatically calculated by ImageMagick according to the target print paper size (letter or DIN A4 or X*Y mm).

How can I do this with ImageMagick?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to cut a long,long pic into multiple pages for print

Post by snibgo »

"-Crop" will chop up the image, eg ...

Code: Select all

convert x.png -crop 1060x600 out.png
... will create 8 output files.

IM knows about many paper sizes, but I never use them so can't advise. See http://www.imagemagick.org/script/comma ... s.php#page
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to cut a long,long pic into multiple pages for print

Post by fmw42 »

To perform this operation I have to cut the picture into multiple chunks.
The width and height of each picture chunk should be automatically calculated by ImageMagick according to the target print paper size (letter or DIN A4 or X*Y mm).

How can I do this with ImageMagick?
No, not to my knowledge. IM is basically a pixel processor. The only command that knows and respects the density is -resample. So you probably need to do those calculations ahead of time to convert dpi to pixels.

See
http://www.imagemagick.org/script/comma ... p#resample
http://www.imagemagick.org/script/comma ... s.php#page
Post Reply