12

How can I split (tile?) one huge PDF onto multiple pages? The result should be one PDF with multiple A4 pages or several A4 PDFs.

I'm not looking for a solution specific to this method of generating the problem: the input PDF has been generated by Graphviz dot, eg. dot -Tpdf sample.dot > sample.pdf. When I did not add a size="8,11"; ratio="fill"; to the graph the output PDF is very large. If I add the size/fill-hints dot only scaled things down for me.

Lets give you one example, if my original PDF was huge like this:

+-------------------+
|                   |
|  O                |
|  :                |
|  :..........C     |
|  :        :       |
|  :        :       |
|  :        :       |
|  :        G       |
|  :        :       |
|  :        :       |
|  :        :       |
|  :        :       |
|  U        :       |
|           B       |
|                   |
+-------------------+

This should be split by a command like

pdftile sample.pdf -x 2 -y 3 > sample-2x3.pdf

into

+---------+---------+
|         |         |
|  O      |         |
|  :      |         |
|  :......|...C     |
|  :      | :       |
+---------+---------+
|  :      | :       |
|  :      | :       |
|  :      | G       |
|  :      | :       |
|  :      | :       |
+---------+---------+
|  :      | :       |
|  :      | :       |
|  U      | :       |
|         | B       |
|         |         |
+---------+---------+
2

6 Answers 6

7

It looks like pdfposter can do this.

3
  • Yeah, it promises to do that, but it does not work :-( Jun 2, 2017 at 13:32
  • @RenéNyffenegger: pdfposter appears to be broken for some people. See this bug report for a workaround.
    – tonysdg
    Sep 11, 2017 at 14:47
  • Exacrtly what I was looking for, I have a large ERD diagram PDF file generated with rails-erd and graphviz, I could turn into a multiple pages file. pdfposter -p2x999a4 gave me 22 pages, -p999x2a4 44 pages
    – Mathieu J.
    Oct 29, 2019 at 23:03
7

Actually mutool has almost the same syntax as the one you're suggesting (are you its author ??) :

mutool -x 2 -y 3 sample.pdf sample-2x3.pdf

To install mutool, just install mupdf, which is probably packaged with most GNU/Linux distributions.

2
  • 1
    worked like a dream to break my A0 poster down to A3 versions for draft printing.
    – oliversm
    Feb 24, 2018 at 15:50
  • 2
    Thank you, did the job in 5 minutes (the package name was mupdf-tools for me). Jul 13, 2022 at 7:38
4

In addition to the tools already mentioned, there is also a tool I wrote because I was unhappy with pdfposter (no overlap between pages for gluing) and wanted more control over the output. The primary interface to the tool is a GUI but it also has a CLI interface that will let you do the same things from the command line. You can grab it here:

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 or are available with each release: https://gitlab.mister-muffin.de/josch/plakativ/releases

plakativ

1
  • Awesome! worked flawlessly. Thanks! Apr 18, 2022 at 4:42
3

Take a look on http://www.graphviz.org/doc/FAQ.html: Q14. How can I print a big graph on multiple pages?

The page attribute, if set, tells Graphviz to print the graph as an array of pages of the given size. Thus, the graph

digraph G { page="8.5,11"; ... }

will be emitted as 8.5 by 11 inch pages. When printed, the pages can be tiled to make a drawing of the entire graph. At present, the feature only works with PostScript output. Alternatively, there are various tools and viewers which will take a large picture and allow you to extract page-size pieces, which can then be printed.

ONLY Postscript! But for automation no showstopper :-). Just let ps2pdf run over it. It worked for me.

1
1

Several linux utilities come to mind:

(from their man pages)

pdfseperate [options] INPUT.PDF OUTPUT%d.PDF

reads INPUT.PDF, extracts one or more pages, and writes one PDF file for each page to OUTPUT%d.PDF (%d is placeholder for page number) (from 'poppler-utils' package)

pdftk INPUT.PDF burst

reads INPUT.PDF, producing one or more PDF files containing individual pages, named 'pg-XXXX.pdf' (unless output filename specified) (from 'pdftk' package)

1
  • these utilities seperate multi-page pdfs into single-page pdfs, this is a single gigantic page pdf. This would be a good answer for this question, if it wasn't already answered: superuser.com/a/997424/11116 Oct 6, 2021 at 20:06
0

As yet another alternative, you can use the cross platform CLI tool pdftilecut which I authored a while ago, to split PDF pages into tiles with trim lines and grid references for easy assembly should you want to print them:

pdftilecut -tile-size A4 -in sample.pdf -out sample-tiled.pdf

You must log in to answer this question.

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