我只是觉得我的头会爆炸,除非有人帮我解决这个问题:
我为 almos 100.000 个注册表中的每一个存储了一对 TIFF 图像(由一个公共密钥相关)。我创建了一个接收密钥并回显 tiff 图像的 PHP 脚本,因此浏览器返回 tiff 图像:
<?php
// Determine the primary key to relate with the image table
$numero_registro = $_GET['numero_registro'];
$imagen = $_GET['imagen'];
if ($numero_registro != "")
{
$con = mysql_connect("localhost","XXXXX","XXXXXX");
if (!$con)
{
die('Problems with db: ' . mysql_error());
}
mysql_select_db("XXXXX", $con);
$result = mysql_query("SELECT img FROM image_table i WHERE i.fk_civil_registry_code = $numero_registro");
$i = 1;
while($row = mysql_fetch_array($result) )
{
if ( $imagen == $i )
{
#img is a long blob field
$ext="tiff";
header("Content-type: image/{$ext}");
echo $row['img'];
}
$i++;
}
mysql_close($con);
}
?>
这只是工作,浏览器显示 tiff 图像。但是,这是一个 tiff 图像,因此会单独显示(并使用 alternaTiff 查看)。直到知道这没问题,因为我只需要打印一个图像。但是现在我的老板买了一台大型自动双面打印机,并把它放在他的办公室里,所以我需要一种方法来生成一个 pdf(两页)并将两个图像(echo $row['img'];)每一个都放在单页,因此他们可以打印 PDF。
谁能帮我做到这一点?
非常感谢。