Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 03-08-2013, 01:28 PM   #1
Registered: Jun 2011
Posts: 82

Rep: Reputation: Disabled
merge pdf files with each file as a index entry in the big pdf

I have a book but instead of one single pdf, i have multiple pdfs for each chapter. so what i want to do is create single pdf with an index (table of content).

so far i have renamed each pdf with following syntax
<same width chapter number>-<chapter name>.pdf
i have been able to merge them into single pdf with correct order with pdfunite. but i cant find how to create index automatically.

thank you
Old 03-08-2013, 07:56 PM   #2
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
found it. .

however jpdfbookmarks command syntax used in pdfdir-join seems outdated, need to be changed to work correctly . in line 129 change
jpdfbookmarks --apply "$outbase".nomarks.pdf "$markfile" "$outbase".pdf
jpdfbookmarks "$outbase".nomarks.pdf --apply "$markfile" --out "$outbase".pdf
thank you bronson
Old 05-12-2014, 11:27 AM   #3
LQ Newbie
Registered: May 2010
Posts: 3

Rep: Reputation: 0
Another more powerful tool

I had the same need and I found another tool that can merge pdf adding the index (TOC): jPDF Tweak.

After added all the files, to add the TOC you have to go in "Bookmarks" tab and add item per item or simply "Load from document" that add an index entry per file.

The good part of jPDF Tweak is that you can do a lot of other modification (watermarking, page resize, rotations...) on the output pdf.

The drawback is that is not a command line tool.
Old 05-12-2014, 11:32 AM   #4
LQ Newbie
Registered: May 2010
Posts: 3

Rep: Reputation: 0
On Stackoverflow I found also another command line tool: sejda
Old 12-08-2017, 08:23 AM   #5
LQ Newbie
Registered: Dec 2017
Posts: 2

Rep: Reputation: Disabled
2017 Update: Here's how to use sejda-console to perform the merge from the command line

sudo apt install ./sejda-console_3.2.43-1_all.deb
sejda-console merge --toc file_names -d /path/to/folder/with/pdf/ -o merged.pdf
Sejda retains all bookmarks by default and they will continue to work in the merged PDF.
The --toc option generates a Table Of Contents as the first page, with clickable links to the page where each merged file starts.

Sejda is OSS software AGPL 3.0 licensed.
Find the latest release here:

Web interface:

Last edited by sunshineinmypocket; 12-09-2017 at 04:51 PM.


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
[SOLVED] Merge pdf files vertically AND horizontally alanv Linux - Newbie 3 12-22-2012 12:45 AM
Has anybody managed to get strigi to index pdf files? allend Slackware 3 06-25-2009 11:21 AM
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 > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:33 PM.

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