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?
-
2Does this answer your question? How do I find the package that provides a file? – muru May 28 '20 at 03:38
-
@muru sorry but no, because the command has been removed from the package where it used to be. – arauzo Jan 30 '23 at 16:37
6 Answers
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

- 15,377
- 3
- 51
- 80
-
4In 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
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.
-
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
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.
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....

- 6,402
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.