[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Ceci est une ancienne révision du document !


Comment fusionner des fichiers PDF

Introduction

PDF (Portable Document Format) est un format de fichier inventé par Adobe. PDF est utilisé pour présenter des documents indépendamment du matériel, des systèmes d'exploitation et des applications. Chaque fichier PDF a une mise en page fixe, incluant la taille de la page, les polices de caractères et d'autres informations. Il est également possible de crypter un fichier PDF pour des raisons de sécurité, ou de créer une signature numérique pour l'authentification.

Travail en cours!!!

Les documents PDF sont créés à partir de documents textuels via un pilote d'imprimante, ou comme avec LaTex, créés directement à partir du code source. Une conséquence importante est qu'on ne peut pas rétroconvertir un document PDF dans son format originel comme le format Microsoft Word par exemple.

Cet article décrit comment vous pouvez fusionner plusieurs documents PDF en un seul document PDF. par exemple, ceci est utile si vous avez scanné plusieurs pages en PDF et que vous voulez concaténer tous ces fichiers PDF en un seul fichier. Il y a plusieurs outils possibles ; certains sont inclus dans l'installation standard de Slackware et les autres peuvent être facilement installés

Default Tools

Tools which are already available on your Slackware computer if you have a complete installation.

imagemagick (convert)

The convert tool comes in Slackware's imagemagick package from the xap-series.

The convert tool uses the -adjoin option to achieve this.

convert -adjoin file1.pdf file2.pdf merged.pdf

Thanks to jlinkels for the contribution.

To increase the quality of the output, it is better to read the input PDF files with a higher density (in dots per inch (DPI)) and then resize the output density back to common DPI, 96 for example. I usually use an input density of 600 (after many trial and errors), and then resize with 93.75% (if you dont resize you will get a huge output file).

convert -density 600 fileinput_1.pdf fileinput2_.pdf -resize 93.75% output.pdf

Thanks to eXpander_ for the contribution.

ghostscript (gs)

The ghostscript package resides in Slackware's ap-series.

With GhostScript you can merge PDF files on the command line.

gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=<newfilename>.pdf <inputfilenameshere>

Thanks to mrclisdue for the contribution.

pdfconcat

The pdfconcat tool comes in Slackware's xpaint package from the xap-series.

pdfconcat -o <output.pdf> <input1.pdf> [...]

Thanks to BroX for the contribution.

pdfunite

The pdfunite tool comes in Slackware's poppler package from the l-series.

pdfunite [options] PDF-sourcefile1..PDF-sourcefilen PDF-destfile

Thanks to nivieru for the contribution.

Additional tools

Additional tools that can be easily installed.

pdftk

pdftk is available at slackbuilds.org. It is also a command line tool and the usage is:

pdftk first.pdf second.pdf third.pdf cat output altogether.pdf

pdftk can do more things than joining PDF files, for example rotating a document by 180 degrees is done this way:

pdftk upsidedown.pdf cat 1-endsouth output rotated.pdf

Thanks to brianL and michaelk for pointing me to pdftk.

pdfshuffler

pdfshuffler is also available at slackbuilds.org. It comes with a graphical user interface and is written in Python, therefore pyPdf and 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 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

texdoc pdfjam

Thanks to joghi for pointing me to pdfjam.

TODO: handling bookmarks in PDF-files, which of the above tools can handle those bookmarks?

Sources

 fr:howtos:software:how_to_merge_pdf-files ()