Re: convert jpeg to size suitable for printing the image on an A4 with lpr
Emanuel Berg <embe8573@student.uu.se> writes:
> This zsh works most of the time: then print the PDF.
> I say "most of the time" as sometimes the image gets
> cut in the edges - I don't know why ...
This hack still hasn't failed me. First, I do a PDF
that is A5 (i.e., smaller than A4). Then I print it on
a regular A4.
#! /bin/zsh
# This file: http://user.it.uu.se/~embe8573/conf/.zsh/jpeg2pdf
# more: ./gfx
# ./dump
# ./x
jpeg2pdf-paper () {
local paper=$1
shift
local pic
local pdf
for f in $@; do
pic=$f
pdf=${pic:r}-$paper.pdf
gs -sDEVICE=pdfwrite \
-sPAPERSIZE=$paper \
-o $pdf viewjpeg.ps \
-c "($pic) viewJPEG showpage"
done
}
jpeg2pdf-a5 () { jpeg2pdf-paper a5 $@ }
jpeg2pdf-a4 () { jpeg2pdf-paper a4 $@ }
jpeg2pdf-a3 () { jpeg2pdf-paper a3 $@ }
alias jpeg2pdf=jpeg2pdf-a4
--
underground experts united
http://user.it.uu.se/~embe8573
Reply to: