Logo Search packages:      
Sourcecode: acidbase version File versions  Download package

Cpdf::addImage ( &$  img,
w = 0,
h = 0,
quality = 75 

add an image into the document, from a GD object this function is not all that reliable, and I would probably encourage people to use the file based functions

Definition at line 2870 of file class.pdf.php.

References addJpegImage_common().

  // add a new image into the current location, as an external object
  // add the image at $x,$y, and with width and height as defined by $w & $h
  // note that this will only work with full colour images and makes them jpg images for display
  // later versions could present lossless image formats if there is interest.
  // there seems to be some problem here in that images that have quality set above 75 do not appear
  // not too sure why this is, but in the meantime I have restricted this to 75.  
  if ($quality>75){

  // if the width or height are set to zero, then set the other one based on keeping the image
  // height/width ratio the same, if they are both zero, then give up :)
  if ($w<=0 && $h<=0){
  if ($w==0){
  if ($h==0){
  // gotta get the data out of the img..

  // so I write to a temp file, and then read it back.. soo ugly, my apologies.

  $tmp = get_magic_quotes_runtime();
  $fp = @fopen($tmpName,'rb');
  if ($fp){
      $data .= fread($fp,1024);
  } else {
    $error = 1;
    $errormsg = 'trouble opening file';
//  $data = fread($fp,filesize($tmpName));
//  fclose($fp);

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index