Location: PHPKode > projects > Lithron > lithron-1.0.2/render.php
<?php header("Content-Type: text/html; charset=utf-8"); ?> 
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="style.css" media="all" />
    </head>
    <body>
        <h1><a href="index.php">lithron test box</a></h1>

        <?php
        require_once("lithron/Lithron.php");

        // check file
        $file = realpath($_REQUEST['file']);
        if (!is_file($file) || !strstr($file, dirname(__FILE__)."/examples")){
            exit("Requested $file is not in example directory!");
        }

        // using php as a template engine ;) Greetings to Jens
        ob_start();
        include($file);
        $xml = ob_get_clean();


        // invoke lithron rendering process
        $L = new Lithron();

        #$L->setTmpPath("output");
        #$L->setDefaultEncoding("iso8859-1"); // if you're using PDFlib Lite, you need to set this to something different than "unicode"

        $L->setIMagickPath("/opt/local/bin;/usr/bin;/sw/bin;/usr/local/bin;");
        $L->setLogLevel(7);
        $L->setXMLString($xml);
        $L->init();
        $L->work();

        foreach ($L->Files as $file)
        {
            // download links
            echo '<h2>Download</h2>';
            echo '<div id="DownloadPanel">';
            echo '<a target="_blank" href="'.$file->FilePath.'">'.$file->propName().'</a>';

            // preview
            echo "<h2>Preview</h2>";
            echo '<div id="PreviewPanel"><iframe src="'.$file->FilePath.'" width="100%" height="600"></iframe></div>';
        }

        // log output
        echo "<h2>Log</h2>";
        echo "<div id='LogPanel'>".Lithron::dumpLog()."</div>";

        // source output
        echo "<h2>Source</h2>";
        echo "<div id='SourcePanel'><pre>";
        $trans = array("<" => "&lt;", ">" => "&gt;");
        echo wordwrap(strtr($L->CleanedXML, $trans),120);
        echo "</pre></div>";

        // credits
        echo "<br/><br/><small>Powered by <a href='http://lithron.de'>lithron</a> from <a href='http://diemeisterei.de'>diemeisterei, Stuttgart</a></small>";
        ?>
    </body>
</html>

Return current item: Lithron