11

I am used to using "pdfjoin", a small utility in older Debian-based distributions (8 and older). When I moved to Ubuntu 18.04, I realized that command is no longer available. Where did it go?

6 Answers6

8

You can get pdfjoin by installing texlive-extra-utils.

sudo apt install texlive-extra-utils

Note that when you install texlive-extra-utils, you ought to download a total of 200+ MB of package, which is may not what you want.

If you only plan to process pdf file, it is more convenient to install the right package— for that I recommend pdftk as it's one of the most popular tools and easy to use, proven to work well in my 18.04 system (which is what I use now !)

To install you can use script created by fellow member @Abu Bua.

wget -P /tmp https://gist.githubusercontent.com/markziemann/c48f74eee3f381308e1482852242a493/raw/4f5767d92e9d8fbd89981e47aa940ea7f2526324/pdftk_installer.sh
chmod 755 /tmp/pdftk_installer.sh
/tmp/pdftk_installer.sh

Taken from https://askubuntu.com/a/1046476/253251

Liso
  • 15,377
  • 3
  • 51
  • 80
  • 4
    In up to data texlive (starting from focal/texlive 2019) pdfjoin is not included any more. See my answer. – Kound Feb 07 '21 at 18:15
6

pdfjoin was part of PDFjam until version 3.02.

It was a simple wrapper script, that still can be found in the pdfjam-extras repository: https://github.com/DavidFirth/pdfjam-extras/blob/master/bin/pdfjoin

To still use it either download the wrapper script and place it in /usr/local/bin or simply add an alias:

$ alias pdfjoin="pdfjam --fitpaper true --rotateoversize true --suffix joined "

given you have pdfjam installed (for instructions see wiki), you can continue to use pdfjoin as you used to in Debian.

eMPee584
  • 214
  • 2
  • 6
Kound
  • 221
  • In 2019 David Firth wrote that he wasn't going to support pdfjam-extras anymore. https://tug.org/pipermail/tex-live/2019-November/044286.html – Knickers Brown Mar 04 '22 at 23:39
3

Add the this function to the ~/.bashrc file or keep as a shell script file.

function combine_pdfs()
{
    output_file=$1
    files=($2)
    gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dAutoRotatePages=/None -sOutputFile=$output_file "${files[@]}"
}

Remember to source the ~/.bashrc file. Then in a terminal in the folder containing the files type:

combine_pdfs blah_blah.pdf 'first.pdf second.pdf third.pdf fourth.pdf'

The above script will create a file blah.pdf which is a combination of first.pdf, second.pdf and third.pdf.

2

A very small but efficient PDF joiner can be found here. I've written it last year for Ubuntu and Arch Linux. It joins PDF Files and images and intends to replace the "old" debian app. You can find a script (install.sh) that will install it in a second....

kanehekili
  • 6,402
1

I have never used that specific tool, but according to this source, it was just a wrapper of pdfjam, so I'd use that utility instead. However, for more complex tasks pdftk is the toolkit to use.

Edit:

After reading the previous answer, I'd like to point out that installing texlive-extra-utils may conflict with a vanilla installation of texlive if you have done so.

1

You can use pdfmod.

sudo apt install pdfmod
Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83