[OS X TeX] How do you use texexec to burst a pdf?

Peter Dyballa Peter_Dyballa at Web.DE
Fri Apr 10 01:10:18 CEST 2009


Am 09.04.2009 um 17:19 schrieb Ramón Figueroa-Centeno:

> Can any body help? (I have seen the pdfselectc work by Claus  
> Gerhart so I know that it should be possible).


You can try this untested (Bourne) shell script:


	#!/bin/sh
	input=`basename "$1" .pdf`
	pages=`pdfinfo "$input.pdf" | grep ^Pages: | awk '{print $NF}'`
	formt=`pdfinfo "$input.pdf" | grep ^Page\ size: | awk '{print $NF}'  
| tr -d '()'`
	i=1
	while test $i -le $pages
	do
	#    texexec --verbose --pdfselect --batch --selection=$1 -- 
result="$input-Page-$i.pdf" "$input.pdf"
	    texexec --verbose --pdfselect --batch --paperformat=$formt -- 
selection=$1 --result="$input-Page-$i.pdf" "$input.pdf"
	    i=`expr $i + 1`
	done

I'm not sure how texexec will handle spaces in file names! You could  
also substitute silent for verbose. (It can be simplified to not use  
pdfinfo but accept parameters instead. Minimum is the number of  
pages. The page's format might be unnecessary, but I haven't tested  
yet.)

--
Greetings

   Pete

There's no place like ~
		– (UNIX Guru)






More information about the macostex-archives mailing list