I'm using Google App Script and I want to convert the contents of a div in a pdf file. I'm trying:
function genPdf(html) { var blob = Utilities.newBlob(html, "text/html", "text.html"); var pdf = blob.getAs("application/pdf"); DriveApp.createFile(pdf).setName("text.pdf"); } The 'html' parameter of the function is passed with a
$('#container').html() The problem is when I get the html of the div with the Jquery's html() function, it returns me the html without the CSS styles and/or images.
I need to generate a PDF with exactly the same content of the div.
Any suggestions?