Export to SVG

  • Dmitrij

    Dmitrij - 2010-10-08


    Is it possible export result to SVG file.
    I am using xsl-fo (ApacheFop) that allowed embed SVG file as xml to pdf file.

    Thank you

  • Dmitrij

    Dmitrij - 2010-10-08

    precise definition: get xml (SVG) of result.

  • ~

    ~ - 2010-10-09

    No, today it is impossible. First of all, because of imagesetpixel and imagegetpixel functions.

  • Anonymous - 2012-10-04

    Sorry to get here this late. Maybe I can help someone.
    I did it this week,

    Fisrt you render the Chart image  to a file. and get its contents into a String:

            $myPicture = new pImage(300, 230, $myData);
            $tstmp = microtime(true);
            $fname = self::$chartPicsDir . "/chart-$tstmp.png";
            $chart = file_get_contents($fname);

    Then you need to Base64_encode it:

    $encodedChart = base64_encode($chart);

    Somehow you make this string available in the XML input to your XSLT => XSLFO, and create a XSLT variable with this value as follows

                                    <xsl:variable name="chart" select="result/chart[1]" />
                                    <fo:external-graphic content-width="342.75pt" content-height="166.5pt" src="url(&quot;data:image/png;base64,{$chart}&#xA;&quot;)" />

    this way you get the embebed image in the XSLFO


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks