使用FPDF和PHP将EPS图像写入PDF

Im using FPDF library to generate PDF files and my requirement is to write .eps/.ai files into PDF file, for that Im using EPS/AI extension for this FPDF(http://www.fpdf.de/downloads/addons/1092/)

but when implement it in my code it is showing Error as

FPDF error: No BoundingBox found in EPS file: my_eps_file.eps

my PHP code is

$pdf->ImageEps('my_eps_file.eps', 15, 70, 20);

I have some text writing functions also in same file, if I remove this eps file writing statement everything is working fine, so I can say there is nothing wrong with library inclusion, but something is going wrong in EPS flow, can some one please help me, thank you.

This function uses "ereg", that is deprecated. You must replace ereg with preg_match.

Replace this line

ereg ("%%BoundingBox:([^
]+)", $data, $regs); 

With this one

preg_match("/%%BoundingBox:([^
]+)/", $data, $regs);

Also replace the line:

$lines = split ("
|[
]", $data); 

with the function preg_split:

$lines = preg_split ("/
|[
]/", $data);