Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
howtos:software:how_to_merge_pdf-files [2013/03/15 09:51 (UTC)] – [gs (GhostScript)] markush | howtos:software:how_to_merge_pdf-files [2013/03/15 17:30 (UTC)] – Added pdfunite as well as other edits allend |
---|
<note important>Work in Progress!!!</note> | <note important>Work in Progress!!!</note> |
| |
PDF documents are created from traditional text-documents via a printer-driver, or as with LaTeX created directly from a source-code. One important consequence is, that one cannot convert a PDF-document "back" into it's original, for example a MS-Word document. | PDF documents are created from traditional text documents via a printer driver, or as with LaTeX, created directly from source-code. One important consequence is that one cannot convert a PDF-document "back" into it's original format such as a Microsoft Word document. |
| |
This article describes, how one can merge several PDF-documents into one. This is useful for example if you have several pages from the scanner in PDF-format and want to put this files to be in one file like the original text. There are several tools, some included in the stock Slackware install, some available via [[http://slackbuilds.org|slackbuilds.org]]. | This article describes how you can merge several PDF documents into a single PDF document. For example, this is useful if you have several pages from a scanner in PDF format and want to put these files into one file. There are several tools available; some are included in the stock Slackware install as well as others that can be readily installed. |
| |
===== The Tools ===== | ===== Default Tools ===== |
| |
At first I will describe the tools which are already available on your Slackware computer if you have a complete installation. | Tools which are already available on your Slackware computer if you have a complete installation. |
| |
==== ghostscript (gs) ==== | ==== ghostscript (gs) ==== |
| |
With GhostScript you can merge PDF files on the commandline | The ghostscript package resides in Slackware's ap-series. |
| |
| With GhostScript you can merge PDF files on the command line. |
<code>gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=<newfilename>.pdf <inputfilenameshere></code> | <code>gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=<newfilename>.pdf <inputfilenameshere></code> |
Thanks to mrclisdue from [[http://www.linuxquestions.org/questions/slackware-14/|linuxquestions.org]] for the contribution. | Thanks to mrclisdue from [[http://www.linuxquestions.org/questions/slackware-14/|linuxquestions.org]] for the contribution. |
| |
==== ImageMagick (convert) ==== | ==== imagemagick (convert) ==== |
| |
convert uses the -adjoin option to achieve this. | The convert tool comes in Slackware's imagemagick package from the xap-series. |
| |
| The convert tool uses the -adjoin option to achieve this. |
<code>convert -adjoin file1.pdf file2.pdf merged.pdf</code> | <code>convert -adjoin file1.pdf file2.pdf merged.pdf</code> |
Thanks to jlinkels at [[http://www.linuxquestions.org/questions/slackware-14/|linuxquestions.org]] for the contribution. | Thanks to jlinkels at [[http://www.linuxquestions.org/questions/slackware-14/|linuxquestions.org]] for the contribution. |
| |
| ==== pdfunite ==== |
| |
| The pdfunite tool comes in Slackware's poppler package from the l-series. |
| |
| <code>pdfunite [options] PDF-sourcefile1..PDF-sourcefilen PDF-destfile</code> |
| Thanks to nivieru at [[http://www.linuxquestions.org/questions/slackware-14/|linuxquestions.org]] for the contribution. |
| |
| ===== Additional tools ===== |
| |
| Additional tools that can be easily installed. |
| |
==== pdftk ==== | ==== pdftk ==== |
| |
pdftk is available at [[http://slackbuilds.org/repository/14.0/office/pdftk/|slackbuilds.org]]. It's also a commandline tool and the usage is: | pdftk is available at [[http://slackbuilds.org/repository/14.0/office/pdftk/|slackbuilds.org]]. It is also a command line tool and the usage is: |
<code>pdftk first.pdf second.pdf third.pdf cat output altogether.pdf</code> | <code>pdftk first.pdf second.pdf third.pdf cat output altogether.pdf</code> |
pdftk can do more things than joining PDF files, for example rotating a document by 180 degrees is done this way: | pdftk can do more things than joining PDF files, for example rotating a document by 180 degrees is done this way: |
<code>pdftk upsidedown.pdf cat 1-endsouth output rotated.pdf</code> | <code>pdftk upsidedown.pdf cat 1-endsouth output rotated.pdf</code> |
Thanks to brianL and michaelk at [[http://www.linuxquestions.org/questions/slackware-14/|linuxquestions.org]] for pointing me to pdftk. | Thanks to brianL and michaelk at [[http://www.linuxquestions.org/questions/slackware-14/|linuxquestions.org]] for pointing me to pdftk. |
| |
==== pdfshuffler ==== | ==== pdfshuffler ==== |
| |
pdfshuffler is also available at [[http://slackbuilds.org/repository/14.0/office/pdfshuffler/|slackbuilds.org]]. It comes with a graphical user interface and is written in Python, therefore [[http://slackbuilds.org/repository/14.0/python/pyPdf/|pyPdf]] and [[http://slackbuilds.org/repository/14.0/python/pypoppler/|pypoppler]] are required in order to get this program to work. It is very convenient because it comes with a document-viewer and shows what you're doing. I has additional features like rotating or splitting PDF files. | pdfshuffler is also available at [[http://slackbuilds.org/repository/14.0/office/pdfshuffler/|slackbuilds.org]]. It comes with a graphical user interface and is written in Python, therefore [[http://slackbuilds.org/repository/14.0/python/pyPdf/|pyPdf]] and [[http://slackbuilds.org/repository/14.0/python/pypoppler/|pypoppler]] are required in order to get this program to work. It is very convenient because it comes with a document-viewer and shows what you're doing. It has additional features like rotating or splitting PDF files. |
==== pdfjam ==== | ==== pdfjam ==== |
| |
pdfjam is a LaTeX-package which is unfortunately **not** included in tetex. But those of us who have instead texlive installed have already pdfjam. It is also a commandline tool (like LaTeX). The documentation is available with the texdoc command | pdfjam is a LaTeX-package which is unfortunately **not** included in tetex. But those of us who have installed texlive instead already have pdfjam. It is also a command line tool (like LaTeX). The documentation is available with the texdoc command |
<code>texdoc pdfjam</code> | <code>texdoc pdfjam</code> |
Thanks to joghi at [[http://www.linuxquestions.org/questions/slackware-14/|linuxquestions.org]] for pointing me to pdfjam. | Thanks to joghi at [[http://www.linuxquestions.org/questions/slackware-14/|linuxquestions.org]] for pointing me to pdfjam. |