10 Replies Latest reply on May 9, 2016 3:28 AM by KevinMortimer

    API for PHP: TCPDF ERROR: [Image] Unable to get the size of the image

    KevinMortimer

      Hi All

       

      I am using the tcPDF php library to display an image stored in a Filmaker database. I am using the Filemaker API for PHP.. The image dispalys fine but the following attached error is also displayed. The pdf should also show a table underneath the image but i think the tcPDF library has a problem with the image from filemaker. Can anyone advise on what i need to do to get it to work.

       

      The file path shown in the error i presume is where the tcPDF library is looking for the image which does not look right to me as the image came from Filmaker. There must be a setting somewhere where tcPDF is looking for the image. Is this what i need to change? Below snippet is in the tcpdf_config.php file. This dir is the C:\Windows\Temp

       

      * Cache directory for temporary files (full path).

      define ('K_PATH_CACHE', sys_get_temp_dir().'/');

       

      Below is a code snippet. Please let me know if you need the other php files to look at.

       

      $records1 = $result1->getRecords();
             foreach($records1 as $record){

              $image = '<img src="containerBridge.php?path=' . $fm->getContainerDataURL(urlencode($record->getField('logoHeader2'))) . '">' ;

              }

        }

      // set default header data

      $pdf->SetHeaderData( $image , 40 , PDF_HEADER_TITLE.' 011', PDF_HEADER_STRING);