cesarvr / pdf-generator-example

HTML to PDF Mobile application.
13 stars 10 forks source link

Instead of raw html .. can i pass id of html div #4

Open vinodvinu103 opened 7 years ago

vinodvinu103 commented 7 years ago

hi sir , i saw the pdf-generator example instead of passing raw html to data key .. can i pass id of div where my entire table n data are present

cesarvr commented 7 years ago

Hi, no you only can pass raw HTML, but you can do something like this $('element').html(), but you should keep in mind you will lost the CSS-styling.

MarouaneSH commented 6 years ago

@cesarvr so how we can pass an HTML element without losing CSS-styling ? should we use canvas ?

cesarvr commented 6 years ago

you need can specify the style like this: $('element').css({"background-color": "yellow", "font-size": "200%"}).html() , but is preferable that you watch the example and pass a template like I do here.