######################################################################
#
#  Turn a latex string into a PNG
#
######################################################################
#
#  __COPYRIGHT__
#
# Copyright 2000-2008 University of Southampton. All Rights Reserved.
# 
#  __LICENSE__
#
######################################################################

use EPrints;

use strict;

my $session = new EPrints::Session;
exit( 0 ) unless( defined $session );

my $latex = $session->param( "latex" );
$latex = "???" if( !defined $latex );

my $pngfile = EPrints::Latex::texstring_to_png( $session, $latex );

$session->send_http_header( content_type=>'image/png' );
open( PNG, $pngfile ) || die "can't open $pngfile";
while(<PNG>) { print; }
close PNG;

$session->terminate();
