21

I have a large image (80cmx40cm) that I want to print on multiple pages of A4 paper (29,7x21 cm).

Usually I use Gimp as my image processor and I could manually chunk the image, but that would be tedious especially as I will need to do this in semi-regular intervals for other images as well.

How can I either print it directly as one image and let the printer do the splitting?

OR how can I split the image into matching chunks?

I'd prefer a setup in Gimp, but will use any other way (including commandline or online-tool, or whatever).

I plan to tape the paper together then manually. So, if I could do the splitting and printing without having a border on the printout that would be a bonus (if not possible, no problem.)

6 Answers 6

26

If you prefer to get it done online, I may suggest this site - http://rasterbator.net/.

Click in Create Poster and upload your image. Select the page size options, Effect options (I used to select none) and keep clicking continue until you reach the download page. PDF file will automatically download and you can open using evince or any other PDF program that you may have and print them out

2
  • 3
    Thanks for the excellent recommendation! Five years later, this tool still works perfectly (in case anyone's wondering).
    – waldyrious
    Jan 30, 2021 at 10:28
  • 3
    It has a 20mb file limit. Apr 9, 2021 at 13:24
16

ImageMagick does this pretty well, by easily splitting an image into equal-sized tiles.

First make sure your image is sized properly so that, after it is split into equal sized tiles, each tile is the size of the paper you are printing to (otherwise you'll be doing a lot of trimming.)

For example, pad your image with white pixels. In the 80x40cm case, your image should be padded to 3x29.7=89.1cm width (three A4 lengths) and 2x21=42cm height (2 A4 widths.)

Suppose that's myimage.jpg, and it's going to be 3 pages across and 2 pages down to print. And suppose it's 300dpi, so the total image is 10523x4960 pixels.

Then you can pad and crop in one go:

$ convert myimage.jpg -extent 10523x4960 -crop 3x2@ +repage mytiles.jpg

(For ImageMagick 7 I believe the command is "magick" rather than "convert")

The "-extent 10523x4960" command changes the "border" size of the original image to include the padding (with white, because we didn't set any special background first.) The "-crop 3x2@ +repage" does the tiling (note the "@" symbol!)

If you want the padding spaced equally on both sides add "-gravity center" before the "-extent".

ImageMagick can handle all kinds of image formats, including straight from pdf to pdf (though you may have to fiddle with the dpi options.)

4
  • Why do I have to resize it to get a "perfect fit"? What happens if I don't? Mar 19, 2019 at 9:18
  • @AngeloFuchs well, the command breaks your image into tiles. So for example if your image is 40cm wide and you split it by width in two, then the tiles will be 20cm wide. So when you print onto A4 paper you'll have to trim them (A4 is 21cm wide.) I guess when I said "resize" in the answer I should have said to pad with unused pixels.
    – Andrew Kay
    Mar 20, 2019 at 10:28
  • 2
    instead of specifying the final number of pages (as in 3x2 in the above example), you can also leave it up to ImageMagick to determine it. This example takes a very long image and divides it into pages based on the pixel dimensions that should go in each page: convert very-thin-high-1100x30000-image.png -crop 1100x8500 +repage paged-output.pdf
    – cengique
    Jun 21, 2020 at 21:12
  • Convert portrait A3 .tif to multipage A4 .tif: convert a3.tif -crop 1x2@ +repage a4.tif. Convert landscape A3 .tif to multipage A4 .tif: convert a3.tif -crop 2x1@ +repage a4.tif. Apr 11, 2021 at 18:00
8

I wrote another tool that can do that job for you. Even though its primary interface is a GUI, it has a command line interface as well. Since you want to do borderless printing, just tell it to use a border of 0 cm.

https://pypi.org/project/plakativ/

If you are on Linux you can install it with pip. Windows executables are also regularly built on AppVeyor CI: https://ci.appveyor.com/project/josch/plakativ/build/artifacts

The source code is hosted here: https://gitlab.mister-muffin.de/josch/plakativ

plakativ

8
  • That helped me immensely. Thank you very much.
    – C.d.
    Jan 7, 2021 at 15:56
  • The "Fit into width/height" and the fact that borders are meant to be trimmed (unlike in rasterbator) was what I was looking for. Would be nicer if it could accept images as input instead of having to use ImageMagic. Solid nonetheless.
    – freshpasta
    Aug 21, 2022 at 22:20
  • @freshpasta plakativ accepts raster images an input since version 0.3 if you also have img2pdf installed which it uses for lossless conversion of your raster images to pdf before plakativ works on them.
    – josch
    Aug 23, 2022 at 18:09
  • @josch It sure does! I was misled by the label "Open PDF". Very nice, thank you.
    – freshpasta
    Aug 25, 2022 at 1:55
  • 1
    @freshpasta thank you, that's a good point! I fixed the label of the button (if img2pdf is installed) here: gitlab.mister-muffin.de/josch/plakativ/commit/…
    – josch
    Aug 26, 2022 at 6:23
4

The first thing to try would be to look at the printer preferences for your printer, and see if it has a feature to split images for you like that. If the printer driver allows that, that's probably the easiest way to do it.

The next thing to try would be to print to PDF, and have Adobe Reader split it across pages -- assuming you have a print-to-PDF printer driver and have Adobe Reader install.

Finally, those solutions don't work, and this is something you'll do frequently, you might create a script for the task.

One sneaky way to script the task would be to create a spreadsheet with a bunch of text expressions that generate HTML or CSS to show only selected portions of your image, then view each chunk of generated in a web browser, and use the browser's print command to print the selected portion of the image. The Stack Overflow question "How can I display just a portion of an image in HTML/CSS?" offers ways to clip an image.

4
  • There is no adobe reader for linux since ages. I'll look into the other suggestions. Thank you. Feb 27, 2016 at 12:03
  • I guess I'm not surprised you're using Linux, since you're using GIMP. But is there a non-Adobe PDF generator or reader? (I don't use Linux much except for software development.) Also, do you understand the idea of using a spreadsheet as a text script generator without further clarification?
    – Steve
    Feb 27, 2016 at 12:13
  • I actually tagged the question linux :) -- There are Linux PDF readers. I didn't find a PDF printer that could do the 'crop to multiple pages' thing. I understood what you meant with the spreadsheet thing but I deemed it pretty complicated. So, while I was looking into PDF printers, the other answer came up and solved the issue - I will not go looking into the spreadsheet thing now :) Feb 27, 2016 at 12:19
  • Aha. I should have looked at the tags. Glad you found a PDF solution, that my spreadsheet idea was clear enough, that you didn't need it, and that I didn't go into details when I wrote the answer.
    – Steve
    Feb 28, 2016 at 19:24
3

I'm printing an infographic which is much taller than it is wide and I want to print it across multiple pages in one column. pdfposter works although I am losing a small bit on page margins, I have not found a way to control size of page margins used yet.

Worked for my infographic:

$ pdfposter -p 1x2a4 in.pdf out_down_2_A4_pages.pdf

$ pdfposter -p 1x3a4 in.pdf out_down_3_A4_pages.pdf

e.g. for printing landscape or wide pdfs:

$ pdfposter -p 2x1a4 in.pdf out_across_2_A4_pages_sidebyside.pdf

$ pdfposter -p 3x1a4 in.pdf out_across_3_A4_pages_sidebyside.pdf

e.g. for blowing up:

$ pdfposter -p 2x2a4 in.pdf out_double_size_4_A4_pages.pdf

$ pdfposter -p 3x3a4 in.pdf out_triple_size_9_A4_pages.pdf

http://manpages.ubuntu.com/manpages/trusty/man1/pdfposter.1.html

sudo yum install pdfposter # or apt-get install pdfposter

1
  • To control the page margins you might want to have a look at plakativ
    – josch
    Aug 1, 2019 at 5:37
3

Alternatively, you can use an open source and cross platform command line tool called pdftilecut which takes an arbitrary PDF file and splits it up so they fit inside the page size you specify. For example:

$ pdftilecut -tile-size A4 -in mars.pdf -out mars_a4.pdf

will cut the pages of the mars.pdf into A4 tiles and stores them in mars_a4.pdf.

I'm the author of this tool.

3
  • Thank you, @Mansour; this worked flawlessly for me. As a side-note for users, expect a 1 in. margin on all sides, so the effective print area dimensions would be reduced by 50,8 mm (2 * 25,4 mm) vertically and horizontally.
    – rolandog
    Aug 12, 2020 at 13:01
  • Did not work correctly for me. The image is still way too large (incorrect DPI).
    – niieani
    Nov 12, 2022 at 8:36
  • > incorrect DPI I don't know what you're referring to by DPI but pdftilecut doesn't do any image<->vector conversion and so DPI doesn't apply here. There may be some other problem, but please file a bug report so it can be fixed. Thanks.
    – Mansour
    Dec 14, 2022 at 12:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .