> i've up loaded to my host account all six .jar files in the batik-
1.6
> directory from the 'binary' download. there are other script files 
contain
> deeper within other directories within this download. do i need to 
upload
> these also?

it would be probably safest to just upload the whole Batik 
distribution to your server and unzip it. But if you want to save 
space or something, this is something either the Batik website may 
answer or people on the Batik mailinglist. My guess is that it needs 
at least the "lib" and maybe the "extensions" directory as well, as 
it contains jar files it depends on. 

> now, andreas kindly sent me an example of how batik commands could 
be sent
> using php.
> 
>  
> 
> $command = '/usr/lib/jvm/jre-1.5.0-sun/bin/java -Xmx512M -jar /
home/
> username/batik/batik-rasterizer.jar -d /home/username/temp/
> somename.pdf -m application/pdf -onload somename.svg';
> $command = escapeshellcmd($command);
> $result = exec($command,$output,$retval);

> ok i think i am clear with this apart from the last line. i 
understand exec
> executes an external program, but where is $output and $retval 
coming from? 
> 

$output and $retval are optional. They contain the output of the 
software executed with $command. It is more for debugging purposes. 
If something goes wrong, you can check the array $output and see if 
it contains error messages. See also http://ch2.php.net/manual/en/
function.exec.php

> 
> i don't know php hardly at all, but i had guessed the java command 
would be
> sent with the POST method.

in my particular example I used the XMLHttpRequest method. This 
allows to send something to the server and get something back without 
having to reload the webpage doing the network request (also known as 
Ajax). In my case the PHP then sent back the full path to the file 
generated by Batik, so a link to the generated file could be 
generated by Javascript.

But of course a regular web form using the get or post method would 
work as well. But in that case, the PHP triggering the batik-
rasterizer process must send back a full webpage, not just a piece of 
information.

> i found a svg to png online converter that used <form
> enctype="multipart/form-data" method="post" ..  > to send a 
command to
> batik. i read this has limited browser support, being limited to 
netscape,
> but it worked fine in ie7. would anyone recommend this method. 
> 

well, this really depends on what you want to do. Generally, the 
XMLHttpRequest is more elegant, since you can exchange information 
with the server, without having to use a new webpage.

> i'm having problems raising my host support. they are usually very 
fast to
> reply but not today.  i wondered if there is a way to check if a 
java
> runtime environment is installed on my host server? and if so how 
to detect
> its path.

well, you could write a PHP script doing a exec to "java -version" 
and "which java". Then you can use the $output array and print out 
all the lines containing the output of the commands.

something like:

$command = escapeshellcmd('java -version');
$result = exec($command,$output,$retval);
print 'Output of java -version: '.implode(",", $output);

and then the same for which java, which should print out the path of 
java, if it can be found.

If it can't be found you can try "locate" or "find".

All these are Unix specific ...

Andreas






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/lOt0.A/hOaOAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to