LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-07-2011, 02:14 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,649

Rep: Reputation: 255Reputation: 255Reputation: 255
How to merge one PDF first side and a second PDF (second side)?


PDF 1 has of page 1,3,5,7,...
PDF 2 has of page 2,4,6,..
=
target : 1,2,3,4...

Is there some script for that please ? With convert or things in the repositories of ubuntu would be perfect
 
Old 01-07-2011, 03:10 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
If you can retrieve or install the latest version of pdftk (1.44) you can try the shuffle feature that does exactly what you're looking for:
Code:
pdftk A=odd.pdf B=even.pdf shuffle A B output final.pdf
For older versions I'm afraid you have to write the entire list of page ranges, using the cat action:
Code:
pdftk A=odd.pdf B=even.pdf cat A1 B1 A2 B2 A3 B3 <and so on> output final.pdf
 
Old 01-07-2011, 10:19 AM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,649

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by colucix View Post
If you can retrieve or install the latest version of pdftk (1.44) you can try the shuffle feature that does exactly what you're looking for:
Code:
pdftk A=odd.pdf B=even.pdf shuffle A B output final.pdf
For older versions I'm afraid you have to write the entire list of page ranges, using the cat action:
Code:
pdftk A=odd.pdf B=even.pdf cat A1 B1 A2 B2 A3 B3 <and so on> output final.pdf
thank you very much !!

is it possible with convert this such operation btw?
 
Old 01-07-2011, 04:23 PM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Do you mean the convert tool from ImageMagick? Sincerely I don't know, but it should be well documented on-line. By the way I find pdftk a very handy tool for this kind of operations. Moreover it is available for the majority of the linux distributions (except for OpenSuSE) even if the latest version might not have been released as binary package, yet.

Last edited by colucix; 01-07-2011 at 04:25 PM.
 
Old 01-08-2011, 05:51 AM   #5
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,649

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
apt-get install pdftk

I do not like it because of that .... too much packages... java and so on... too much unecessary packags
what do you think? (bit package bloated no?)

Code:
The following extra packages will be installed:
  gcj-4.4-base gcj-4.4-jre-lib libbcmail-java libbcmail-java-gcj libbcprov-java libbcprov-java-gcj
  libgcj-bc libgcj-common libgcj10 libgnuinet-java libgnujaf-java libgnumail-java libitext-java
  libitext-java-gcj
Suggested packages:
  libbcmail-java-doc libbcprov-java-doc libgcj10-dbg libgcj10-awt libgnumail-java-doc
The following NEW packages will be installed:
  gcj-4.4-base gcj-4.4-jre-lib libbcmail-java libbcmail-java-gcj libbcprov-java libbcprov-java-gcj
  libgcj-bc libgcj-common libgcj10 libgnuinet-java libgnujaf-java libgnumail-java libitext-java
  libitext-java-gcj pdftk
0 upgraded, 15 newly installed, 0 to remove and 213 not upgraded.
Need to get 29.4MB of archives.
After this operation, 72.2MB of additional disk space will be used.
Do you want to continue [Y/n]? y
 
Old 01-08-2011, 06:09 AM   #6
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,649

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by Xeratul View Post
apt-get install pdftk

I do not like it because of that .... too much packages... java and so on... too much unecessary packags
what do you think? (bit package bloated no?)

Code:
The following extra packages will be installed:
  gcj-4.4-base gcj-4.4-jre-lib libbcmail-java libbcmail-java-gcj libbcprov-java libbcprov-java-gcj
  libgcj-bc libgcj-common libgcj10 libgnuinet-java libgnujaf-java libgnumail-java libitext-java
  libitext-java-gcj
Suggested packages:
  libbcmail-java-doc libbcprov-java-doc libgcj10-dbg libgcj10-awt libgnumail-java-doc
The following NEW packages will be installed:
  gcj-4.4-base gcj-4.4-jre-lib libbcmail-java libbcmail-java-gcj libbcprov-java libbcprov-java-gcj
  libgcj-bc libgcj-common libgcj10 libgnuinet-java libgnujaf-java libgnumail-java libitext-java
  libitext-java-gcj pdftk
0 upgraded, 15 newly installed, 0 to remove and 213 not upgraded.
Need to get 29.4MB of archives.
After this operation, 72.2MB of additional disk space will be used.
Do you want to continue [Y/n]? y


cannot it be more automoatic such as :

Code:
pdftk merge odd.pdf even.pdf output final.pdf
because I do not know always how much pages and how much order it is always : 1 2 3 4 5 ...
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Comparing Kernel Dmesgs: Remove Timing Info and Diff Side by Side LXer Syndicated Linux News 0 08-04-2010 07:31 PM
Installing SUSE 11.1 side by side with Ubuntu already installed on a USB drive jjchavez Linux - Laptop and Netbook 2 09-12-2009 01:39 PM
LXer: Top Linux photo managers side-by-side LXer Syndicated Linux News 0 12-14-2006 06:33 PM
need a server side pdf merge tool siyisoy General 2 06-05-2006 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:48 PM.

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