星期一, 二月 17, 2014

Jpg/jpeg to pdf, two pics a page, command line

Requirement:
cups-pdf
E.g., yum install cups-pdf

Device:
lpstat -p -d

printer Cups-PDF is idle.  enabled since ...

Cups-PDF may be different on different machines.

Scripts:
#!/usr/bin/env bash
for i in *jpg
do
convert $i `basename $i .jpg`.pdf
done

pdfunite *pdf oo.pdf

lpr -P Cups-PDF -o number-up=2 oo.pdf
Result:

On Fedora, result file oo.pdf can be found in ~/Desktop.

Reference:
https://www.cups.org/documentation.php/doc-1.3/options.html

没有评论: