3

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.

Farzad
  • 842
  • 2
  • 9
  • 26
user2398514
  • 137
  • 4
  • 17
  • Is this even supported in FPDF? I have been searching through the class file for that method, and I don't see it --- at least in the new releases? – Shmack Jan 26 '21 at 19:08

2 Answers2

0

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

Replace this line

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

With this one

preg_match("/%%BoundingBox:([^\r\n]+)/", $data, $regs);
Prescol
  • 615
  • 5
  • 12
0

Also replace the line:

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

with the function preg_split:

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