저는 pdf 보고서를 생성하기 위해 post-to-pdf라는 Wordpress 플러그인을 사용하고 있으며, pdfs를 만들기 위해 dompdf를 사용합니다. 나는 phplot을 사용하여 보고서에 그래프를 추가했습니다. 그래프는 pdf로 잘 변환되지만 나머지 리포트는 사라지고 그래프 크기를 조정할 수 없습니다. 그래프를 이미지로 배치하려고했습니다. 어떤 아이디어?phplot 그래프를 dompdf에 올바르게 표시하려면 어떻게합니까?
//The graph function
function graphmaker(){
// Include Graph
include(PDFEXPORT_PLUGIN_PATH.'/graph/phplot/phplot.php');
//Define the object
$plot = new PHPlot(800,600);
//Define some data
$example_data = array(
array('a',3),
array('b',5),
array('c',7),
array('d',8),
array('e',2),
array('f',6),
array('g',7)
);
$plot->SetDataValues($example_data);
//Turn off X axis ticks and labels because they get in the way:
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
//Draw it
$plot->DrawGraph();}
return '<img src="'. graphmaker() .'" width="200" height="200">';
코드를 보면 PDF의 make % PDF-1.3이 맨 위 줄의 % PNG로 대체되고 있습니까?
그 그래프는 PHP 이미지입니다. – user1721230