[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to use makefile to work with psnup



On 12/14/05, H. S. <hs.samix@gmail.com> wrote:
> I am trying to make a makefile to convert PDFs in a directory to 4-up
> PDFs using psnup but I am not able to.

Off hand, I'd probably use something like:

#### BEGIN MAKEFILE ####
SRCS := $(filter-out %-4up.pdf,$(wildcard *.pdf))
DESTS := $(patsubst %.pdf,%-4up.pdf,$(SRCS))

default : $(DESTS)

%.ps : %.pdf
        acroread -toPostScript $<

%-4up.ps  : %.ps
        psnup -m0.5cm -l -Pletter -pletter -4 $< > $@

%-4up.pdf  : %-4up.ps
        ps2pdf $<

#### END MAKEFILE ####

Remember to change the spaces to tabs for the action lines.  Gmail
won't let me enter a tab by hand.  There's a circular dependency, but
it doesn't seem to cause problems.  Since you have tighter naming
rules, you can probably change

%.ps : %.pdf

to

%N.ps : %N.pdf

--
Michael A. Marsh
http://www.umiacs.umd.edu/~mmarsh
http://mamarsh.blogspot.com



Reply to: