I Have integrated mxGraph in my codeignitore plategorme but when u try to export using the export form I get error 500 when I checked I found out that the getimage method receives s null value I traceback processed and found that the value is not empty but the vml I am sending is containing ... and all examples I mxgraph are having ... structure . Is there a way then to convert my vml go be similar
I have this PHP code to export the XML code recieved from the POST Methode
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Canvasexport extends MY_Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
echo 'Index';
}
public function saveLocal()
{
include_once("libexport/src/mxServer.php");
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$xml = urldecode($_POST["xml"]);
$format = urldecode($_POST["format"]);
$filename = urldecode($_POST["filename"]);
$image = mxGraphViewImageReader::convert($xml, "#FFFFFF");
header("Content-Type: image/png");
echo mxUtils::encodeImage($image);
}
}
}
The codeignator shows this error:
A PHP Error was encountered Severity: Error
Message: Call to a member function getImage() on null
Filename: reader/mxGraphViewImageReader.php
Line Number: 279
Backtrace:
I noticed that the XML i have is defferent from the sample files they have in the MxGraph examples. Mine is like this:
<mxGraphModel dx="1102" dy="603" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" background="#ffffff"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="whiteSpace=wrap;html=1;aspect=fixed;fillColor=#B3B3B3;" parent="1" vertex="1"><mxGeometry x="333.5" y="230" width="80" height="80" as="geometry"/></mxCell><mxCell id="3" value="" style="shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;size=0.16111111111111112;fillColor=#9999FF;" parent="1" vertex="1"><mxGeometry x="313.5" y="310" width="120" height="60" as="geometry"/></mxCell><mxCell id="4" value="" style="shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;rotation=-180;size=0.16111111111111112;fillColor=#7EA6E0;" parent="1" vertex="1"><mxGeometry x="313.5" y="170" width="120" height="60" as="geometry"/></mxCell><mxCell id="5" value="<h1>Heading</h1><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1"><mxGeometry x="278.5" y="440" width="190" height="120" as="geometry"/></mxCell><mxCell id="6" value="&laquo;interface&raquo;<br><b>Name</b>" style="html=1;fillColor=#B3B3B3;" parent="1" vertex="1"><mxGeometry x="130" y="80" width="110" height="50" as="geometry"/></mxCell><mxCell id="15" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;" parent="1" source="7" target="11" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="7" value="Classname" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;" parent="1" vertex="1"><mxGeometry x="100" y="320" width="140" height="104" as="geometry"/></mxCell><mxCell id="8" value="+ field: type" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="7" vertex="1"><mxGeometry y="26" width="140" height="26" as="geometry"/></mxCell><mxCell id="9" value="+ field: type" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="7" vertex="1"><mxGeometry y="52" width="140" height="26" as="geometry"/></mxCell><mxCell id="10" value="+ field: type" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="7" vertex="1"><mxGeometry y="78" width="140" height="26" as="geometry"/></mxCell><mxCell id="11" value="Classname" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;" parent="1" vertex="1"><mxGeometry x="590" y="320" width="140" height="104" as="geometry"/></mxCell><mxCell id="12" value="+ field: type" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="11" vertex="1"><mxGeometry y="26" width="140" height="26" as="geometry"/></mxCell><mxCell id="13" value="+ field: type" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="11" vertex="1"><mxGeometry y="52" width="140" height="26" as="geometry"/></mxCell><mxCell id="14" value="+ field: type" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="11" vertex="1"><mxGeometry y="78" width="140" height="26" as="geometry"/></mxCell><mxCell id="16" value="Transaction" style="shape=ext;rounded=1;html=1;whiteSpace=wrap;double=1;fillColor=#B3B3B3;" parent="1" vertex="1"><mxGeometry x="100" y="200" width="120" height="80" as="geometry"/></mxCell><mxCell id="18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.25;exitY=0.2;exitPerimeter=0;jettySize=auto;orthogonalLoop=1;" parent="1" source="17" target="11" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="17" value="" style="shape=parallelMarker;html=1;fillColor=#B3B3B3;" parent="1" vertex="1"><mxGeometry x="530" y="160" width="70" height="70" as="geometry"/></mxCell></root></mxGraphModel>
with the mxGraphModel tags and not the graph tag as theirs which is like this:
<graph label="My Diagram" x="90" y="50" width="400" height="280">