Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-13-2011, 08:25 PM   #1
LQ Newbie
Registered: Jun 2010
Distribution: Fedora
Posts: 23

Rep: Reputation: 0
Question Merge pdf files vertically AND horizontally

Hello, I have two questions:

1. Is there an easy way to combine pdf files not only one "after" the other, but also one "next to" the other? For example, If I have one-page files called a1.pdf, a2.pdf, a3.pdf, a4.pdf, b1.pdf, b2.pdf, b3.pdf, b4.pdf, c1.pdf, c2.pdf, c3.pdf, c4.pdf, I want to combined them so that I can scroll down from a to c and scroll right from 1 to 4. That is, I want to merge them in "matrix form". If I zoom out the final file should look like:

a1 a2 a3 a4
b1 b2 b3 b4
c1 c2 c3 c4
(TWELVE pages in total)

Is this possible? I tried Google but found no information.

2. Also, is it possible to just put all of them together in a single page. If I zoom out the page should look like:
(ONE page in total)


Note: I would like to do this for many one-page files
Old 04-13-2011, 09:08 PM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.7, Centos 5.10
Posts: 16,917

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
If you can't find a 'simple' tool to do it, you may have to create your own using Perl, prob this module
If you go this route, I'd also post the qn at; it's where the Perl gurus hang out and you should get some good advice/code.
Old 12-21-2012, 08:20 AM   #3
LQ Newbie
Registered: Dec 2012
Location: France
Distribution: Slackware current
Posts: 1

Rep: Reputation: Disabled


My answer may come a bit late for you, however it may benefit others.

1. I don't know any answer to your first question. It looks to me more of a presentation problem . It is the PDF viewer's job to arrange pages (ie: one after the other). Pages are usually displayed from top to bottom. Some viewers (like Evince for example) can display a "dual" view, like when reading a book. So you would get

-- ee
a1 a2
b1 b2
if you had only two columns and not four. 'ee' is an empty page that fills the place of the first page, which is odd (a real page in a book is made of an odd, then an even page).

2. One possible answer to your second question is to use PDFjam. It is a shell-script interface to the "pdfpages" LaTeX package. Google for the URL, the forum doesn't allow me to put it here because it's my first post.

The quick fix to your problem is:
$ pdfjam --suffix nup --nup 4x3 --no-landscape a1.pdf a2.pdf a3.pdf [...]
This will arrange your original documents on ONE page of 3 rows x 4 columns. You can experiment with and without landscape (--landscape).

PDFjam's behaviour can be customised through parameters (look at the source code to understand them, the man page is quite light). This is useful for other PDF operations too (join, n-up join, split, n-split, flip, reflect etc.).

Then there is the alternate version of using PDF and PS manipulating libraries in a more generic programming language, as chrism01 suggested. Or the hard-core one where you learn directly PostScript and PDF, edit by hand the documents, and then use Ghostscript to generate the result.

Hope this helps!

Last edited by 1gn1t10n; 12-21-2012 at 08:34 AM.
Old 12-22-2012, 12:45 AM   #4
LQ Newbie
Registered: Jun 2010
Distribution: Fedora
Posts: 23

Original Poster
Rep: Reputation: 0
Thumbs up

Hi 1gn1t10n,

Thank you for taking the time to reply to this old question of mine. I just tried it and it works.


merge, pdfs

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: An easy way to Spilt or Merge PDF Files in Linux LXer Syndicated Linux News 0 04-17-2009 04:00 PM
How to force monitor to display vertically instead of horizontally? jsstevenson Linux - Hardware 3 02-04-2008 03:49 PM
merge multiple pdf files esteeven Linux - Software 8 11-21-2007 02:59 PM
How To Merge multiple files into a single PDF ? kkempter Linux - Software 1 10-28-2005 02:02 PM

All times are GMT -5. The time now is 12:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration