Currently, I have a PHP application that produces barcodes in HTML. It uses the following line:
// Create the Barcode
if ($obj) {
if ($obj->DrawObject($xres)) {
echo "<td><img src=''></td>";
} else {
echo "<td><font color='#FF0000'>" . ($obj->GetError()) . "</font></td>";
}
} else {
echo "<td><font color='#FF0000'>Obj is false; Barcode = " . $barcode . "</font></td>";
}
where image.php is creating the image. Now I need to do the same thing except for a PDF file.. In the following code, I am reading in a JPEG file, but I want to avoid the use of a file, and want to use a "data stream" instead.
$fn = "dsc_5525.jpg";
$fh = fopen($fn, "r");
$data = "" filesize($fn));
fclose($fh);
$image = $pdf->jfif_embed($data);
$pdf->image_place($image, 50, 0, $firstpage);
In other words, I want to put the barcode date into $data and I am not sure how to do this. Any help is greatly appreciated.
Todd
--