1

Hi,

I have generated PDF with upto 200 images , but my pdf needs a sign image also to be inserted
so when i add the sign image to the images in the PDF .

It is giving the 'impossible to load the image error.

Can Anyone help me how to solve it.

Bijith

2

what is the src of the img ? if it is a image generate by php, see the example 9
Ancien pseudo : lolo

3

<td width="260" style="border-bottom:1px solid black;"><?php if ($orderData['IbsOrder']['ord_curr_order_stage'] == 10) { ?>
<img src="<?php echo $filePath;?>" width="311" height="49" />&nbsp;
<?php } ?></td>

This is the src of the image when the time comes to load this image it is giving the message
impossible to load image

4

ok, but what is "$filePath" ? is it a real image, or a image generate by PHP ? could you tel me the value of $filePath ?
Ancien pseudo : lolo

5

the value of filePath is the path to the sign image

it will be like http://ibs.prithvisolutions.com/cakephp/app/webroot/ibs/97/sign.jpg

images are stored in the DB and they are read from the db and written to the location mentioned above

6

If the path/file you give as example is the one used in your script, it wont work ! (404 error)
Not Found

The requested URL /cakephp/app/webroot/ibs/97/sign.jpg was not found on this server.
Apache/2.2.6 (Fedora) Server at ibs.prithvisolutions.com Port 80

The file must exist and must lead to a correct image file.
avatar

7

Hi,
I just have us an example it just gives the format of the src link that all, it was not of a working image
but my src links are formed like this and they are not loading

8

have you try to make a fopen directly on $filePath ?
Ancien pseudo : lolo

9

this is my code

$dbImage = $appr_details[0]['user']['usr_signature_img'];
$dbFileName = $appr_details[0]['user']['usr_signature_name'];           
$parentFolder = WWW_ROOT.'ibs'; 			 
exec("mkdir $parentFolder");  
exec("chmod -R 777 $parentFolder"); 
$folder = WWW_ROOT.'ibs/'. $_SESSION['user']['usr_profile_id'];  
exec("mkdir $folder");
$File = $folder .'/'.$dbFileName;
$Handle = fopen($File, 'w'); 
fwrite($Handle, $dbImage);
fclose($Handle);  
$domain =  $_SERVER['SERVER_NAME'];
$server= $_SERVER['SCRIPT_NAME'];
$server = str_replace("/index.php","",$server);
$server = preg_replace("/\//","",$server);
$filePath = "http://$domain/$server/app/webroot/ibs/$user_id/$dbFileName";
$this->set('filePath', $filePath);

10

According to fpdf documentation, here's the compatibility chart :
Supported formats are JPEG, PNG and GIF. The GD extension is required for GIF.

For JPEGs, all flavors are allowed:

* gray scales
* true colors (24 bits)
* CMYK (32 bits)

For PNGs, are allowed:

* gray scales on at most 8 bits (256 levels)
* indexed colors
* true colors (24 bits)

but are not supported:

* Interlacing
* Alpha channel

For GIFs: in case of an animated GIF, only the first frame is used.

If a transparent color is defined, it is taken into account.

Hope this will help.



Edit : first of all, is the image displayed in your browser ?
avatar

11

Ancien pseudo : lolo