Search code examples
imagefpdffileserver

Fpdf images from server


What is the easiest way to get images from the fileserver into a pdf with fpdf? In my database I stored only the image URLs but I need to get the actual file.


Solution

  • Set your variable:

    $image1 = "img/products/image1.jpg";

    U can simply create a new string and add the extension

    Then ceate a cell, position it. $this->Cell( 40, 40, $pdf->Image($image1, $pdf->GetX(), $pdf->GetY(), 33.78), 0, 0, 'L', false );