Author Topic: Batch files for converting multiple PDFs with SWFtools  (Read 1792 times)

hiddink

  • Newbie
  • *
  • Posts: 4
Batch files for converting multiple PDFs with SWFtools
« on: May 03, 2010, 05:31:27 pm »
Hello,

I just converted >1000 PDFs to .swf (Debian). I created some shell-scripts which helped me out:

For a single PDF [pdf2swf.sh]
Code: [Select]
#!/bin/bash

if [ $# -ne 2 ];then
 echo “Usage: $0 target.pdf outfile”
 exit
fi

TARGET=$1
OUTFILE=$2

mkdir ${OUTFILE}-swf
pdf2swf -O 1 -s zoom=72 ${TARGET} ${OUTFILE}-swf/%.swf

For a folder containing multiple PDFs (batchpdf2swf.sh):
Code: [Select]
#!/bin/bash
for i in *.pdf;do ./pdf2swf.sh "$i" "${i%.pdf}";done

  • Adjust the params in the first file to your needs (see http://www.swftools.org)
  • Swftools should be installed on your UNIX-system
  • The second script calls the first one, both should be present in the folder where the PDFs reside.
I hope it helps someone, I'll post updates, I am also working on a PHP-script for reading out the folders that were created with .swf files. That way, I created >1000 books during a short coffee-break!!!!

Regards,
Bert

BENDOO e-work solutions 
www.bendoo.nl 

« Last Edit: May 03, 2010, 06:14:54 pm by hiddink »