Hi
I have an issue when trying to convert (HtmlToPdf) Google Maps in EO.Pdf. The space where the map should show up is "just empty/white/transparent". It's important to mention that this happens only for embedded Google Maps (Google Maps Embed API) which is using an iframe. Google Maps generated through the Google Maps Javascript API is looking fine. As Google Maps Javascript API is not rendered in an iframe but is drawing the map in the same document I suspect it must have something to do with the rendering in an iframe but I could be wrong of course.
Example embed.html:
Quote:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Google Maps Embed example</title>
</head>
<body>
<h1>Google Maps Embed</h1>
<iframe id="embed1"
width="500"
height="300"
style="border:5px solid red"
loading="lazy"
allowfullscreen
referrerpolicy="no-referrer-when-downgrade"
src="//www.google.com/maps/embed/v1/place?key=API_KEY&q=Space+Needle,Seattle+WA">
</iframe>
<h1>Google Maps Embed (output)</h1>
<iframe id="embed2"
width="500"
height="300"
style="border:5px solid red"
src="//maps.google.com/maps?q=Space+Needle,Seattle+WA&t=&z=13&ie=UTF8&iwloc=&output=embed"
allowfullscreen>
</iframe>
<script>
setTimeout(() => {
// give it time to render once again
if (typeof eoapi !== 'undefined') {
eoapi.convert();
}
}, 5000);
</script>
</body>
</html>
And the C# code (Using newest EO.Pdf version in Trial mode)
Quote:
var embed = GetHtml("embed.html");
using (var outputStream = File.Open("embed.pdf", FileMode.Create))
{
HtmlToPdf.ConvertHtml(embed, outputStream, new HtmlToPdfOptions
{
BaseUrl = "http://localhost",
TriggerMode = HtmlToPdfTriggerMode.Dual,
MinLoadWaitTime = 5000
});
}
The DebugUI also never shows any content for this page. Only the red borders from the <iframe> are visible. Inspection / DOM wise, the content should be there (divs rendered). Network wise, the scripts, images and icons are all fetched from google.
Any help is much appreciated!
Thanks!
Daniel