cesarvr / pdf-generator

Cordova plugin to generate pdf in the client-side
MIT License
106 stars 62 forks source link

Creating PDF from local HTML with dynamic content elements #111

Open wenzerl opened 4 years ago

wenzerl commented 4 years ago

I am using var param ="file:///android_asset/www/print.html"; printInternalFile(param); to generate a PDF from inside a Cordova app. Basically this is working fine, but the dynamic content doesn´t show. This content is generated locally, e.g. from local storage a saved user name is integrated in this print page and a graph is generated depending on user input via chartjs. Can this be done somehow? Thanks, Werner

JustWoody commented 4 years ago

If this is dynamic then you could use fromData method rather than from file? and pass in the html string you have in memory instead? this works for me with dynamic content