title: Laravel PDF Generation with Google Map Issue
body: <p>I am using Barryvdh DOMPDF to generate a pdf from view to PDF in Laravel . Everything is working fine other than a Google Map. This is how I am doing</p>
  
  <ol>
  <li><p>Created a new root</p>
  
  <pre><code>Route::get('/printPDF', 'Printer@printPDF');
  </code></pre>
  
  <ol start="2">
  <li><p>In Printer Controller, created a function printPDF and call Google Map Api to get and save map on the server</p>
  
  <pre><code>$sMapa= public_path("temp/test5".".png");
  $image = file_get_contents('http://maps.googleapis.com/maps/api/staticmap?center='
  . $sLat. ",". $sLong
  . '&amp;maptype=hybrid'
  .'&amp;zoom=18&amp;size=510x250&amp;markers=size:tiny|color:red|'
  . $sLat. ",". $sLong);
  
  $fp= fopen($sMapa, 'w+');
  fputs($fp, $image);
  fclose($fp); 
  </code></pre></li>
  </ol></li>
  </ol>
  
  <p>It created the map and save it as Test5.png file on server.</p>
  
  <p>Now we load the view to generate PDF and use test5.png in that view, with absolute path.</p>
  
  <pre><code>    $pdf = "";
      $pdf = \PDF::loadView('main_pdf', $data);
      $file = "data/report/".$pdf_filename;
      file_put_contents($file, $pdf-&gt;output());
  </code></pre>
  
  <p>PDF is generated but the Map (test5.png) is not correctly placed, it is distorted. like this <a href="https://i.stack.imgur.com/2MO1S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2MO1S.png" alt=" See the attachment"></a></p>
  
  <p>Can someone please figure out what is the issue and how to fix it?</p>
  
  <p>The image on the server is fine and not damaged.</p>