0

STEP 0 : Install

Install program pdftk and imagemagick :

sudo apt-get install pdftk imagemagick

STEP 1 : Convert

Input is :
/image/topic-01/01-01.jpg
/image/topic-02/02-01.jpg
/image/topic-02/02-02.jpg
/image/topic-03/03-01.jpg

Output is :
- topic-01.pdf (1 pages)
- topic-02.pdf (2 pages)
- topic-03.pdf (1 pages)

Basic convert :

find /image -type d | while read d; do convert "${d}"/.jpg ./"${d##/}.pdf"; done

Option resize convert(Reduced quality) :

find /image -type d | while read d; do convert -density 150 -quality 50 "${d}"/.jpg ./"${d##/}.pdf"; done

STEP 2 : Combine

Input is :
*pdf

Output is :
onefile.pdf

Combine pdf files :

pdftk *pdf cat output onefile.pdf

Edited by Athicom

2
Contributors
1
Reply
26
Views
2 Years
Discussion Span
Last Post by Gribouillis
1

You can also use /usr/bin/pdfunite to merge several pdf into one (in ubuntu, install package poppler-utils for this)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.