- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2017 04:50 PM
One of my team-mates created a very nice HTML report widget in Service Portal. Now the client would like to save a PDF copy of the report. I know we can render HTML fields as PDF but how do you get the HTML contents of a widget back to the server side for further processing and attaching to a record?
Thanks for the advice. I'be been playing around with html2canvas with nor progress.
Mike
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 03:56 AM
Answer my own question:
In the HTML:
we tag the div with an ID
<div id = "preview">
We also add a button:
<button type="submit" ng-click="c.canvas()" class="btn btn-primary">Canvas</button>
In the client script a function that is called by the button:
c.canvas = function preview(){
c.data.myHTML = document.getElementById('preview').innerHTML;
c.server.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 03:56 AM
Answer my own question:
In the HTML:
we tag the div with an ID
<div id = "preview">
We also add a button:
<button type="submit" ng-click="c.canvas()" class="btn btn-primary">Canvas</button>
In the client script a function that is called by the button:
c.canvas = function preview(){
c.data.myHTML = document.getElementById('preview').innerHTML;
c.server.update();
}