javascript - Generate PDF from HTML with Map (exactly a screenshot) -
hi have html content , map, using leaflet api map rendering (jsfiddle) this whole content part of modal panel open on button click after user input data. want export content pdf client side solution.
i have tried jspdf like not works. tried combination of canvastohtml , jspdf like not able make work either. point mentione here content contains map export jspdf doesn't support
anyone knows solution, please share. have included code below
ps: using phamtomjs screenshot utilities not option
<script src="https://npmcdn.com/leaflet@1.0.0-rc.3/dist/leaflet.js"></script> <link href="https://npmcdn.com/leaflet@1.0.0-rc.3/dist/leaflet.css" rel="stylesheet" /> <body> <script> function createmap(mapplaceholderid) { var osm_map_tile_server_url = 'http://{s}.tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png'; var default_map_center = l.latlng(25.296854389343867, 51.48811340332031); var default_map_zoom = 12; var map_zoom_max = 19; var map_zoom_search = 17; var osmurl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmattrib = 'map data © <a href="http://openstreetmap.org">openstreetmap</a> contributors'; var osm = new l.tilelayer(osmurl, { minzoom: 8, maxzoom: 12, attribution: osmattrib }); var map = l.map(mapplaceholderid).setview([51.505, -0.09], 13); map.addlayer(osm); return map; } </script> <div id="vrsubreportcontainer"> <div class="mappopuptablecontainer"> <div class="mappopuptabledata"><b>plate number:</b> 009-001gl-297286, <b>driver name:</b> unknown driver <br><b>latitude,longitude</b>: 25.215238,51.605439</div> </div> <div id="mapcontainer" class="map-container"> <div class="map" id="fd_map_canvas"></div> </div> </div> <script> (function() { createmap('fd_map_canvas'); })(); </script> </body>
Comments
Post a Comment