Rendering geo map field in PDF

12 October, 2019 14:32:35
cocacool
Topics: 1
Messages: 2
Hi there,

I am tinkering with E2PDF to see if it fits our needs before purchase.
I am working with ACF and have a field in there of the Type OpenStreetMap. It is like a google maps field
but driven by leaflet.js dynamically
When I link it in the PDF it only shows either raw data or the DIV as a rendered string, almost as if the JS does not get triggered.

What causes this behaviour, and is it possible to make it work?

I also tried to do a custom shortcode and registered it in functions.php as dicribed in your forum, but no luck

Suggestions are very much appriciated
12 October, 2019 15:35:44
E2Pdf
Support
Topics: 7
Messages: 3330
Hi,

Unfortunately, to output map inside PDF it must be converted to image (JavaScript in PDFs doesn't work the same way as in "HTML"). Currently E2Pdf can't convert it in "auto" mode. We will check the possibility to extend this functionality, but at this moment the only way is to create custom shortcode which will generate Image Url from your coordinates as "Value" for "E2Pdf" Image Object.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
12 October, 2019 16:31:34
cocacool
Topics: 1
Messages: 2
Hey Oleksandr,

thanks for the quick response.
That's what I thought. Well ok then.

Maybe it can be done giving additional options to image field where you could specify a DIV to be rendered with "html2canvas" https://html2canvas.hertzen.com/
you could specify the DIV of the Map, load it with preset viewport size (image dimensions) and render it to the canvas as PNG in BASE64 to be displayed? or even cached

just an idea
12 October, 2019 16:44:41
E2Pdf
Support
Topics: 7
Messages: 3330
Thank you for the idea. We will check this option.

We remain at your service.
We would really appreciate your feedback at WordPress.org!