title: import a google static map directly in fpdf
body: <p>I wanted to place a google static map in a pdffile generated by using the fpdf extension.
  and used code to make a tempfile first. Using this code. However I run into an error ('can't open image file').</p>
  
  <pre><code>// define the mapurl 
  $fullURL = 'http://maps.googleapis.com/maps/api/staticmap?center=Amsterdam&amp;z=14&amp;size=100x100&amp;sensor=false';
  // create a tempfile            
  $tempF = tmpfile();
  fwrite($tempF, file_get_contents($fullURL));
  //Rewind to the start of file
  rewind($tempF);
  // place the image in the pdf.
  if (!empty($tempF)) {
      $this-&gt;Image($tempF,$start_x, $this-&gt;GetY(),0,100);
  }
  fclose($tempF);  // remove the tempfile
  </code></pre>