8

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

Although I generated the PDF with dot I would like to have this problem solved in general -- or at least on a standard Ubuntu (eg. 12.04).

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       |
|         |         |
+---------+---------+

I looked into the pdfjam toolset but it seems this feature is not implemented there. I would like it to be a command line tool -- and it should be automated, not manually

7

It looks like pdfposter can do this.

  • Yeah, it promises to do that, but it does not work :-( – René Nyffenegger Jun 2 '17 at 13:32
  • @RenéNyffenegger: pdfposter appears to be broken for some people. See this bug report for a workaround. – tonysdg Sep 11 '17 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 at 23:03
5

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.

  • worked like a dream to break my A0 poster down to A3 versions for draft printing. – oliversm Feb 24 '18 at 15:50
3

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)

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.