

Combine pdfs linux pdf#
When you run the command mergepdf at the command line, followed by the names of the PDF files you want to combine, Ghostscript creates the file output.pdf. bashrc (found in your /home directory) and add something like this to the file: alias mergepdf='gs -dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOutputFile=output.pdf' An easier way of using that command is to turn it into an alias. The command above is a lot to remember, especially if you only combine PDF files every so often. That makes a little more sense now, doesn't it? Turning That Into a Single Command -sOutputFile=newFile.pdf tells Ghostscript to combine the files (whose names come at the end of the command) into a file named newFile.pdf.-sDEVICE=pdfwrite tells Ghostscript to output a PDF file.-dQUIET tells Ghostscript not to display output from the command.

-dNOPAUSE tells Ghostscript not to prompt you at the end of each page.-dBATCH tells Ghostscript to stop running after combining the files.Let's break that command and its options down: Once you're there, run this command: gs -dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOutputFile=newFile.pdf pdfFile1.pdf pdfFile2.pdf pdfFile3.pdf Then, navigate to the folder containing the PDF files that you want to combine. The command line I typically use (on a linux box) is of the form: Code: Select all gs -dNOPAUSE -sDEVICEpdfwrite -sOUTPUTFILEMerged.pdf -dBATCH 1.ps 2.pdf 3.pdf You can mix and match postscript and pdf files for the inputs.

To do that, crack open a terminal window. I use Ghostscript directly to merge postscript and PDF files.
Combine pdfs linux install#
If it isn't already installed on your computer, install Ghostscript using your distribution's package manager or software centre. Ghostscript is standard kit with many Linux distributions. You'll only need one piece of software: Ghostscript, which is a set of programs that interpret and render Postscript and PDF files. Let's take a look at a quick and dirty way to combine PDFs at the Linux command line. For the command line junkie, the latter option might be the preferred option. Or you can jump to the command line and use software that's probably already on your computer. To do that deed, you can use a pair of tools that I introduced a while back. That's especially true when you need to mash two or more PDF files together - say, when you're adding a cover to a book. While PDF files have their uses, they can be a bit of a pain to work with.
