6

I have a PDF with 4 pages. I want to create another PDF where the pages are positioned one after the another (Vertical aligment) in a single page. Which commandline tool can be used for that?

Dingo
  • 2,389
  • 1
  • 20
  • 31
user567879
  • 4,780
  • 18
  • 62
  • 99

2 Answers2

5

there are several ways to perform this task, one easier, one harder


The EASIER: A MULTIVALENT.JAR WAY

Multivalent.jar is a stunning piece of free software able to perform many useful tasks on pdf

you can download from one of these links (the 2009 multivalent.jar build available on sourceforge has no more pdf tools inside)


  • assuming your multipage pdf is in ISO A4 size (21x29.7cm), type:

java -cp path..to/Multivalent.jar tool.pdf.Impose -dim 4x1 -paper 84x29.7cm input.pdf


this is the resulting page, composed by the 4 sequential pages stitched side by side together:

4_pdf_pages_appended_side_by_side

explication:

-dim 4x1 means number of columns for rows

-paper 84x29.7cm means paper size of your final imposed document containing the 4 pages joined side by side. obviously, since in your final pdf file, you will have 4 columns and only one row, you need to multiply by 4 the document witdh (21 cm)

multivalent can accept, as unity input, also inches (-paper 33.4x11.68in) or postscript points (-paper 2380x841pt)



THE HARDER: A LATEX WAY:

4_pdf_pages_appended_side_by_side

some years ago, Peter Flynn, in comp.text.pdf suggested, for a similar task, a way to appending pdf pages side by side with the only help of LateX. If you are a LaTeXian, you can act as follows:

since you need to append side by side the four pages of your single multipage pdf, you will write a latex preamble, creating a new document like this:

assuming your pdf document has name input.pdf and its size is ISO A4, and you have this multipage pdf in your working folder, you will have

\documentclass[a4paper]{article}
\usepackage[margin=0mm,nohead,nofoot]{geometry}
\usepackage{pdfpages}
\pagestyle{empty}
\parindent0pt
\begin{document}
\includepdfmerge[nup=1x4,landscape]{input.pdf,1,input.pdf,2,input.pdf,3,input.pdf,4}
\end{document}
Dingo
  • 2,389
  • 1
  • 20
  • 31
  • 1
    Thanks for pointing me to a good version of Multivalent. I strongly recommend getting it from http://ge.tt/#!/21OPDHX/v/4 as the other link redirects you to another domain and wants to download a .exe file. It might be a self-extracting archive, but I suspect it will install other cruft as well. – samwyse Sep 24 '13 at 14:24
  • many thanks; I replaced the ziddu link (even if using adblock and noscript you are able to download multivalent.jar without pain - the -exe is a downloader tool for ziddu site but you are able to skip this and download only the Multivalent.jar file-) with rapidshare link; the best option I think could be add a torrent link in future – Dingo Sep 24 '13 at 14:30
  • In the latex way, what should I do if I have 4 single-page pdf files? – qed Nov 10 '13 at 22:50
  • Just use `\includepdfmerge[nup=1x4,landscape]{input1.pdf,1,input2.pdf,1,input3.pdf,1,input4.pdf,1}` – Francesco Pasa Nov 10 '17 at 11:01
1

If you use a Unix-like operating system, there is pdfjam, which combines the Latex backend with an easy command:

pdfjam --nup 1x4,landscape input.pdf

Foxhole
  • 192
  • 1
  • 8