Claudiu Creanga
Claudiu Creanga

Reputation: 8366

Image as a variable then insert it using FPDF and PHP

So, I am new to fpdf. Maybe someone knows how to get an image with a variable and then insert it in a cell. There is something wrong with my sintax.

$image1 = "../_resources/img/xstampa/stampa_18_grey.png";

$stampanumero = $letterposition[$position].$image1;
$p->Cell(7, 5, $stampanumero, 1,'L');

The problem is that $image1 is printed as text ../_resources/img/xstampa/stampa_18_grey.png. It does not grab the image.

Upvotes: 1

Views: 2532

Answers (1)

GBD
GBD

Reputation: 15981

Try this way: So create image with

$p->Cell(7, 5,$p->Image('../_resources/img/xstampa/stampa_18_grey.png',10,10,-300), 1,'L');

Upvotes: 4

Related Questions