2

I use PHPGraphlib to render graph and TCPDF to generate PDF report. Now i want to render my chart on pdf file.

I have file chart.php

<?php
include("phpgraphlib.php");
$graph = new PHPGraphLib(400,300);
$data = array("Alex"=>99, "Mary"=>98, "Joan"=>70, "Ed"=>90);
$graph->addData($data);
$graph->setTitle("Test Scores");
$graph->setTextColor("blue");
$graph->createGraph();
?>

And the second file is render.html

<html>
<h3>This is where I want to display my graph</h3>
<img src="chart.php" />
</html>

My problem is how render the content of render.html in my pdf file.

Thank you

jarmouz
  • 175
  • 1
  • 1
  • 7

1 Answers1

0

This is the solution

$pdf->Image('http://127.0.0.1/glib/examples/chart.php',60,180,0,0,'', '', '', true, 150, '', false, false, 0, false, false, false);
jarmouz
  • 175
  • 1
  • 1
  • 7