I've seen various answer to this, but for whatever reason I cannot seem to get them to work.
First, I'm pulling the file from my database:
try {
$getQuery = "SELECT * FROM firstForm WHERE id =:id";
$statement = $db->prepare($getQuery);
$statement->execute(array(':id' => 2));
if($row = $statement->fetch()) {
$fileName = $row['pic'];
}
}
When I echo $fileName it produces "data:image/png;base64..."
How do I convert $fileName so I can use it in fpdf, like so:
$pdf = new FPDF('P','in','A4'); // orientation (portrait), inches, ??
$pdf->SetMargins(0.5,0.5,0.5); // l, t, rs
$pdf->AddPage();
$pdf->Cell(4,3,'', 1, 2, 'C'); // w, h, text, border width, ???, align
$pdf->Image($fileName);
$pdf->Output();