#!/usr/bin/perl -w # script written by K.-H. Herrmann June 2005 # creates a Open Office Impress presentation from # a list of images (assuming full page images) # get "high" res images with: # gs -dNOPAUSE -r300 -sDEVICE=pngalpha -sOutputFile=testoutput_%d.png -dBATCH file.pdf # # for LaTeX/beamer slides the following produces exactly 1024x768 images # #gs -dNOPAUSE -g1024x768 -r205 -sDEVICE=pngalpha \ # -sOutputFile=Talkimg_%d.png -dBATCH Talk.pdf use OpenOffice::OODoc; if ((@ARGV <1) or (@ARGV > 2)){ print << "EOF"; Usage: img2ooImpress.pl ImageFileList [outputfile.swi] ImageFileList est un fichier contenant toutes les images à importer dans l'ordre correct. EOF exit; } my $outputfile; my $imgFileList=shift; $outputfile="img2ooImpressExport.swi" unless $outputfile=shift; open (IN,"<$imgFileList") ou mourir "Impossible de lire $imgFileList\n"; my $document = ooDocument ( file => $outputfile, create => 'presentation' ); $document->createImageStyle("slide"); my $i=1; while (my $imgfile=){ chomp($imgfile); my $test= $document->appendElement ('//office:body',0,'draw:page'); my $image= $document->createImageElement ( "Diapositive".$i, description => "image ".$i." nom_de_fichier :".$imgfile, page => $test, position => "0,0", import => $imgfile, size => "28cm, 21cm", style => "slide" ); $i++; } $document->save;