decode($doc->documentElement, $graph->getModel()); // // $image = $graph->createImage(null, "#FFFFFF"); $filename = "diagrams/graphview.xml"; //echo mxGraphViewHtmlReader::convertFile($filename); // Creates a PNG representation of the file $image = mxGraphViewImageReader::convertFile($filename, "#FFFFFF"); // Creates an interlaced image for better loading in the browser //imageInterlace($image, 1); // Marks background color as being transparent //imageColorTransparent($image, imageColorAllocate($image, 255, 255, 255)); header("Content-Type: image/png"); echo mxUtils::encodeImage($image); } // Uses a local font so that all examples work on all platforms. This can be // changed to vera on Mac or arial on Windows systems. mxConstants::$DEFAULT_FONTFAMILY = "ttf/verah.ttf"; // If you can't get the fonts to render try using one of the following: //mxConstants::$DEFAULT_FONTFAMILY = "C:\WINDOWS\Fonts\arial.ttf"; //mxConstants::$DEFAULT_FONTFAMILY = "verah"; putenv("GDFONTPATH=".realpath("./ttf")); //mxConstants::$TTF_ENABLED = false; main(); ?>