Hi, i'm just feeling that my head will explode unless someone help me with this problem:
I have stored a pair of TIFF images (related by a common key) for each one of almos 100.000 registries. And I create a PHP script that receives a key and echo the tiff image, so the browser return the tiff image:
<?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);
}
?>
This just works and the tiff image is displayed by the browser. But, this is a tiff image, so is displayed lonely (and viewed using alternaTiff). Until know this was no problem, cause I just needed to print a single image. But now my boss buy a big automatic duplex printer, and put it on his office, so I need a way to generate a pdf (of two pages) and put both images (echo $row['img'];) each one on a single page, so they can print the PDF.
Can anyone help me to do that?
Thank you very much.