comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL eps outpt converted to png for MS PowerPoint
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDL eps outpt converted to png for MS PowerPoint [message #48591] Fri, 28 April 2006 08:43 Go to next message
newbie16 is currently offline  newbie16
Messages: 11
Registered: December 2004
Junior Member
Hi All:

Recently I found myself having to convert *a lot* of eps figures I
created using IDL into png format for a PowerPoint presentation. Well,
this was kinda a pain to do, so I wrote a couple of small BASH shell
scripts to ease the whole process. I provide below:

(1) A small README file
(2) "idl2ppt.sh" the main workhorse
(3) "make_runall.sh" calls idl2ppt.sh to make many png files

Please note that they work for a Linux workstation where ImageMagick's
"convert" funtion is installed.

I hope someone finds these useful!

Cheers,

tyler

====> The files

The small shell script idl2ppt.sh is used to convert the figures in its

current directory to PNG format for use in PowerPoint presentations.
For
many files to be converted at once (most likely case), just run the
make_runall.sh script and walk away.

USAGE: For single files, just use idl2ppt.sh without arguments for
help.
For multiple files, run make_runall.sh.

EXAMPLES

FOR MANY FILES:
---------------

$ sh make_runall.sh <--- Uses default density of 900

FOR A SINGLE FILE:
------------------
N.B.: []-optional density argument as a number

$ sh idl2ppt.sh <filename.eps> [####]

# *** End of file: README_idl2ppt.txt *** #


===> The next file

#!/bin/sh
#
# This file was created on the 22 March, 2006, by Tyler Hayes
#
# To convert many eps output files from IDL into something usable by
# PowerPoint is typically a pain in the ass. I wrote this BASH script
# to save time and energy.
#
# Typically I output EPS files from IDL so I can insert them into a
LaTeX
# document with relative ease. However, for presentation purposes, I
# prefer to use PowerPoint. Unfortunately, PowerPoint doesn't like
# EPS files. So what to do? Well, on Linux machines, we can use
# the wonderfull command "convert" from ImageMagick.
#
# The method I use is a modified version of the one found in the
# document "makeps.ps" by Carl Heiles and Tim Robishaw
#
############################################################ ##############


# Check for proper input and that the file exists!
############################################################ ##############
if [ $# -lt 1 ]
then
# Proper usage output
echo ''
echo ===========================================================
echo Hey, Bozo!
echo
echo Usage\: 'sh idl2ppt.sh' \[\<datafile\>\] \[\<density\>\]
echo ' '
echo ' 'Where \<datafile\> is the EPS figure from IDL, and
echo ' 'the \<density\> is a number such as 600 or 1200.
echo ' 'The default value is set to 800.
echo ''
echo ===========================================================
echo ''
exit 0
else
ls $1 2> /dev/null | grep $1 > /dev/null
# Making sure the file exists in the directory
if [ $? != 0 ]
then
echo ' '
echo ===========================================================
echo Buddy, you\'re killin\' me...Where\'s \"$1\"
echo ===========================================================
echo ' '
exit 0
fi
fi


# Create the variables to be pumped into convert
############################################################ ##############
infile=$1
if [ $# -ne 2 ]
then
dens=800
else
dens=$2
fi

# Set the default density value
density=`echo -density $dens`

# Change this line to get the extension type you want if other than PNG
outfile=`echo $infile | awk -F"\." '{print $1".png"}'`


# Use ImageMagick's CONVERT function
############################################################ ##############
convert -antialias $density $infile $outfile

if [ $? = 0 ]
then
echo ' '
echo ===========================================================
echo $infile converted to PNG format.
echo ===========================================================
echo ' '
exit 0
fi

echo Exiting
exit 0

# *** End of file: idl2ppt.sh *** #




====> The last file


#!/bin/sh
#
# This file was created on the 22 March, 2006, by Tyler Hayes
#
# This file will creates the runall.sh file to create many PNG figures
from
# the EPS files. You MUST have idl2ppt.sh in this directory.
#
############################################################ ##############

# Create variables
echo " "
echo Creating variables...
echo " "
all=`echo runall.sh` # The name of the script to runall figs!
epslist=/tmp/eps$$ # The temporary file of eps figure names
echo Listing all EPS files in the current directory...
echo " "
ls *.eps > $epslist

# Prepend the idl2ppt.sh command to ls *.eps
awk '{print "sh idl2ppt.sh",$1}' $epslist >> $all
echo $USER, now running \"$all\".
echo Be sure to have idl2ppt.sh in your current directory.
echo " "

# Run the newly made shell script
sh $all

# Remove unwanted files
echo Removing dummy list
rm $epslist

# Remove unwanted files and exit
echo Removing dummy shell script file
rm runall.sh

# Exit program
echo Now exiting. Goodbye $USER.
echo " "
exit 0

# *** End of file: make_runall.sh *** #
Re: IDL eps outpt converted to png for MS PowerPoint [message #48595 is a reply to message #48591] Fri, 05 May 2006 05:18 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
...and for the people on Windows there is always Photoshop that does a
great job at batch processing.

Haje
Re: IDL eps outpt converted to png for MS PowerPoint [message #48598 is a reply to message #48591] Thu, 04 May 2006 21:12 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
newbie16@hotmail.com wrote:

> Hi All:
>
> Recently I found myself having to convert *a lot* of eps figures I
> created using IDL into png format for a PowerPoint presentation. Well,
> this was kinda a pain to do, so I wrote a couple of small BASH shell
> scripts to ease the whole process. I provide below:
>
> (1) A small README file
> (2) "idl2ppt.sh" the main workhorse
> (3) "make_runall.sh" calls idl2ppt.sh to make many png files
>
> Please note that they work for a Linux workstation where ImageMagick's
> "convert" funtion is installed.
>
> I hope someone finds these useful!
>
> Cheers,
>
> tyler


Hi tyler

you should have a look at pstoimg too.
That is much more comfortable

e.g.
pstoimg -type png -crop tblr -aaliastext -flip r90 -density 150 *


density of 150 is for powerpoint enough because the screen do have something
about 72 only.


man
http://hepunx.rl.ac.uk/~adye/pstoimg.html

cheers

Reimar
>
> ====> The files
>
> The small shell script idl2ppt.sh is used to convert the figures in its
>
> current directory to PNG format for use in PowerPoint presentations.
> For
> many files to be converted at once (most likely case), just run the
> make_runall.sh script and walk away.
>
> USAGE: For single files, just use idl2ppt.sh without arguments for
> help.
> For multiple files, run make_runall.sh.
>
> EXAMPLES
>
> FOR MANY FILES:
> ---------------
>
> $ sh make_runall.sh <--- Uses default density of 900
>
> FOR A SINGLE FILE:
> ------------------
> N.B.: []-optional density argument as a number
>
> $ sh idl2ppt.sh <filename.eps> [####]
>
> # *** End of file: README_idl2ppt.txt *** #
>
>
> ===> The next file
>
> #!/bin/sh
> #
> # This file was created on the 22 March, 2006, by Tyler Hayes
> #
> # To convert many eps output files from IDL into something usable by
> # PowerPoint is typically a pain in the ass. I wrote this BASH script
> # to save time and energy.
> #
> # Typically I output EPS files from IDL so I can insert them into a
> LaTeX
> # document with relative ease. However, for presentation purposes, I
> # prefer to use PowerPoint. Unfortunately, PowerPoint doesn't like
> # EPS files. So what to do? Well, on Linux machines, we can use
> # the wonderfull command "convert" from ImageMagick.
> #
> # The method I use is a modified version of the one found in the
> # document "makeps.ps" by Carl Heiles and Tim Robishaw
> #
> ############################################################ ##############
>
>
> # Check for proper input and that the file exists!
> ############################################################ ##############
> if [ $# -lt 1 ]
> then
> # Proper usage output
> echo ''
> echo ===========================================================
> echo Hey, Bozo!
> echo
> echo Usage\: 'sh idl2ppt.sh' \[\<datafile\>\] \[\<density\>\]
> echo ' '
> echo ' 'Where \<datafile\> is the EPS figure from IDL, and
> echo ' 'the \<density\> is a number such as 600 or 1200.
> echo ' 'The default value is set to 800.
> echo ''
> echo ===========================================================
> echo ''
> exit 0
> else
> ls $1 2> /dev/null | grep $1 > /dev/null
> # Making sure the file exists in the directory
> if [ $? != 0 ]
> then
> echo ' '
> echo ===========================================================
> echo Buddy, you\'re killin\' me...Where\'s \"$1\"
> echo ===========================================================
> echo ' '
> exit 0
> fi
> fi
>
>
> # Create the variables to be pumped into convert
> ############################################################ ##############
> infile=$1
> if [ $# -ne 2 ]
> then
> dens=800
> else
> dens=$2
> fi
>
> # Set the default density value
> density=`echo -density $dens`
>
> # Change this line to get the extension type you want if other than PNG
> outfile=`echo $infile | awk -F"\." '{print $1".png"}'`
>
>
> # Use ImageMagick's CONVERT function
> ############################################################ ##############
> convert -antialias $density $infile $outfile
>
> if [ $? = 0 ]
> then
> echo ' '
> echo ===========================================================
> echo $infile converted to PNG format.
> echo ===========================================================
> echo ' '
> exit 0
> fi
>
> echo Exiting
> exit 0
>
> # *** End of file: idl2ppt.sh *** #
>
>
>
>
> ====> The last file
>
>
> #!/bin/sh
> #
> # This file was created on the 22 March, 2006, by Tyler Hayes
> #
> # This file will creates the runall.sh file to create many PNG figures
> from
> # the EPS files. You MUST have idl2ppt.sh in this directory.
> #
> ############################################################ ##############
>
> # Create variables
> echo " "
> echo Creating variables...
> echo " "
> all=`echo runall.sh` # The name of the script to runall figs!
> epslist=/tmp/eps$$ # The temporary file of eps figure names
> echo Listing all EPS files in the current directory...
> echo " "
> ls *.eps > $epslist
>
> # Prepend the idl2ppt.sh command to ls *.eps
> awk '{print "sh idl2ppt.sh",$1}' $epslist >> $all
> echo $USER, now running \"$all\".
> echo Be sure to have idl2ppt.sh in your current directory.
> echo " "
>
> # Run the newly made shell script
> sh $all
>
> # Remove unwanted files
> echo Removing dummy list
> rm $epslist
>
> # Remove unwanted files and exit
> echo Removing dummy shell script file
> rm runall.sh
>
> # Exit program
> echo Now exiting. Goodbye $USER.
> echo " "
> exit 0
>
> # *** End of file: make_runall.sh *** #
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Animation formats revisited
Next Topic: Re: Problem with save and VM

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:24:57 PDT 2025

Total time taken to generate the page: 0.00676 seconds