I'm using css, jquery and nodejs (with ejs and express) to create a website and I need to export a div with some text and some divs with a background-image as an image (jpg or png) but the best would be pdf. I tried to use html2canvas but then I read that it is not compatible with nodejs. I also tried with jspdf but it doesn't export the css in the pdf file. So I would like to know if anyone knows a solution that can do that with nodejs.
Here is an exemple of my ejs code :
<%for(var j = 0; j < rawData.scanner.length; ++j) {%>
<div class="grid" id="grid-<%= data.scanner[j].camera%>"
style="
width : <%= parseFloat(data.widthScreen) + 17%>px;
height : <%= parseFloat(data.heightScreen) + 17%>px;
position : absolute;
left : 0px;
top : 60px;
overflow-x : scroll;
overflow-y : scroll;
display : none;">
<%for(var i = 0; i < data.scanner[j].parts; ++i) {%>
<div class="fenetre" id=<%= data.scanner[j].name + "-img" + i%>
style="
background-image : url(<%= (data.scanner[j].imagePath)%>);
width : <%= data.scanner[j].width%>px;
height : <%= data.scanner[j].height%>px;
position:absolute;
top: 0px;
left: <%= (i * data.scanner[j].left)%>px;"
>
</div>
<%}%>
</div>
<%}%>
Your html code
' – Jared Chu Aug 28 '17 at 01:40