Karakas Online

3.3.2. ...and ps2png!

ps2png can be implemented in many ways, a simple one is the following short script[1] (taken from http://stud3.tuwien.ac.at/~e9902644/work/invocation.html:

# /usr/local/bin/ps2png
for i in "$@"
        i_new=`dirname $i`/`basename $i .ps`.png
        echo convert $i to $i_new
        gs -dNOPAUSE -sDEVICE=png256 -sOutputFile=$i_new -q -dBATCH $i
#        convert -rotate 90 $i_new $i_new
#        convert -resize 50% $i_new $i_new
#convert -transparent white test.png test.png

Now, to output both pages in one (-2 option), switch to landscape mode[2] (-L) and dump the contents in a PNG image with 256 colours (in order to be "web safe), we only need to type:

html2ps -2 -L http://somesite.com/somepage.html > somepage.ps
ps2png somepage.ps

You can write a html2png script containing just these two lines - and you are done! Inline graphic



Commented code is not needed, but is "nice to have" just in case.


Remember that the original HTML page was too large for a screen dump without scrolling.