Combining png images into a single pdf file

How can I combine multiple .png files into a single pdf file on Unix?

+48
merge unix pdf png
Jan 24 '11 at 4:27
source share
3 answers

Looking through the ImageMagick documentation, it can be as simple as:

 convert 1.png 2.png myfile.pdf 

If this does not work, PDFjam claims it can solve your problem.

+98
Jan 24 2018-11-11T00:
source share

If I want to combine some scans into one PDF file, I do this:

 pdfjoin --a4paper --fitpaper false --rotateoversize false scan01.png scan02.png 

This gives you a PDF document with a DIN-A4 page size, where each png file is centered on its own page. Images that are too large for a single DIN-A4 page are resized proportionally to one page. Smaller images do not change (do not enlarge).

You must name all png files on the command line, but you can also use wildcards to, for example, merge all png files in the current directory:

 pdfjoin --a4paper --fitpaper false --rotateoversize false *.png 

The pdfjoin team is part of the PDFjam, as stated in Jeremy Willcock's answer. Therefore, you will most likely have to install a package called pdfjam with your distros package manager. PDFjam can use png files as input from version 2.07 released in 2010-11-13.

+17
Jul 01 '13 at 19:18
source share

I stole it, but this is the solution I used from Jeremy Willcock and another answer website. At the moment, the story does not break through. I lied, understood. (Tully @ https://askubuntu.com/a/626301 )
I need a file small enough to send via email.

Combining images in PDF (from the working directory, use the command line:

 user@box:/home/user/scans/:$ convert 1.png 2.png convertoutput.pdf 

To compress the use of ghostscript after merging (I used the kde system almost by default):

This is 1 line command, not 3

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=output.pdf convertoutput.pdf

There were 14 images in my file (19 MB after conversion, gs did it 1.6 MB, quality is still great) The output file output.pdf is called

0
Nov 29 '17 at 23:28
source share



All Articles