charris1980 Posted February 15, 2008 Share Posted February 15, 2008 I am trying to grab an image from the DB, it is a longblob type. I'm using ezpdf right now, and using ezImage isn't doing anything. If I use ezText just to see if it grabbed it, then it will display the cryptic text of that longblob. I guess my question is, is there a way to show this longblob image in a PDF? Link to comment https://forums.phpfreaks.com/topic/91280-pdf-ezimage-and-longblob-images/ Share on other sites More sharing options...
amites Posted February 15, 2008 Share Posted February 15, 2008 why are you storing an image in your database? makes the server happier to store the directory of the image and then call it in normally.... just a thought Link to comment https://forums.phpfreaks.com/topic/91280-pdf-ezimage-and-longblob-images/#findComment-467795 Share on other sites More sharing options...
charris1980 Posted February 15, 2008 Author Share Posted February 15, 2008 yeah i know. i wish it was my choice, and if this isn't possible it will be the ammo to switch it back to that. for now though they wanted it in the DB. Link to comment https://forums.phpfreaks.com/topic/91280-pdf-ezimage-and-longblob-images/#findComment-467801 Share on other sites More sharing options...
charris1980 Posted February 15, 2008 Author Share Posted February 15, 2008 i think i figured it out. kind of a weird solution though. create-pdf.php (snip) //php code that looks up the image based on ID and displays it. $filename = "/show-image.php?image_id=150"; //copies the image to a .tmp file on the disk. copy($filename, "/var/www/temppdfimage.img.jpeg"); //refreshes the page to the actual ezPDF code that pulls that .tmp file. echo "<meta http-equiv=\"refresh\" content=\"0;url=/pdf-test.php?id=58507\">\r\n"; seems to work so far anyway. just have to make the ID's variable _GETs now. I just hard coded them to test it. Link to comment https://forums.phpfreaks.com/topic/91280-pdf-ezimage-and-longblob-images/#findComment-467879 Share on other sites More sharing options...
charris1980 Posted February 15, 2008 Author Share Posted February 15, 2008 didn't really want to bump this, can't find a edit button. anyway i guess i really over thought this because below worked fine for me create-pdf.php (snip) $row = mysql_fetch_array($result); $imageurl = "http://www.website.com/show-image.php?imageid=" . $row['image_id'] . ""; $doc->ezImage($imageurl, '100', '150', 'none', 'right'); show-image.php (snip) $connection = mysql_connect($host, $user, $pass); mysql_selectdb($dbname, $connection); $sql = "SELECT image FROM `images_table` WHERE `image_id` = " . $image_id; $result = mysql_query($sql, $connection); $img = mysql_fetch_row($result); print $img[0]; just thought i would share... Link to comment https://forums.phpfreaks.com/topic/91280-pdf-ezimage-and-longblob-images/#findComment-468040 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.