0

I'm running both OS : mac os X and windows xp.

On mac os X, i'm running MAMP and I used the solution Batik to export my chart (highchart) on my own server. Everything is doing well.

On windows xp, I'm running Easyphp. Unfortunately, I'm not able to run this command :

shell_exec("java -jar ". BATIK_PATH ." $typeString -d $outfile $width temp/$tempName.svg");

Safe mode is disabled in php_ini

In my opinion, it's about the definition of java's path under PHP. I don't know how to fix it. Does someone could help me in this issue ?

Thanks

megahigh
  • 11
  • 1

2 Answers2

1

I solved a part of my problem with reinstalling jre !

My new issue is that my code is not generating a JPG.

The SVG file is well generated but just after, the shell_exec of Batik jar give me this answer :

About to transcode 2 SVG file(s)

Converting 0 to 07273dd0571b92c3ee6817638418f839.jpg\0.jpg ... ... error (SVGConverter.error.cannot.open.source)
Converting 07273dd0571b92c3ee6817638418f839.svg to 07273dd0571b92c3ee6817638418f839.jpg\07273dd0571b92c3ee6817638418f839.jpg ... ... success

I do not understand why it's trying to transcode 2 files. And I do not understand why he apparently can't open a file he just create.

At the end I have a folder named : "07273dd0571b92c3ee6817638418f839.jpg"

and inside I find a jpg named : "07273dd0571b92c3ee6817638418f839.jpg"

Strange....

Thanks MH.

megahigh
  • 11
  • 1
0

In the php code on high chart there are a little problem. If you see on this line

// size
    $with ='';
    if ($_POST['width']) {
        $width = (int)$_POST['width'];
        if ($width) $width = "-w $width";
    }

If you don't send with as post you have something like this

$output = shell_exec("java -jar ". BATIK_PATH ." $typeString -d $outfile $with temp/$tempName.svg");

$output = shell_exec("java -jar ". BATIK_PATH ." $typeString -d $outfile "SPACE" temp/$tempName.svg");

The "SPACE" take a position and the script "think" you have other image.

You can send the width size or eliminate this on the script, look below, or use other options, see it here:

$output = shell_exec("java -jar ". BATIK_PATH ." $typeString -d $outfile temp/$tempName.svg");