I am working on java and angularjs. I have an html page that iterates an object and displays the values ββon the page.
html code:
<div id="{{value.pageIndex}}" ng-repeat="(key, value) in employees" class="myDivClass">
<div>
<h1><font color="red"> {{value.pageHeader}}</font></h1>
</div>
<div>
<h1> {{value.pageIndex}}</h1>
</div>
<div>text from html page</div>
</div>
I should not enclose the above html code inside another div, as it will not be able to execute my other script in my application.
I want to export the content above html to PDF when the user clicks the button, the problem is when I try to get the value from the html page as shown in the js code below, only the first iterated data is exported to where I want everything Data has been exported to PDF.
js code:
$scope.export = function() {
var pdf = new jsPDF('landscape');
source = $('.one1');
pdf.addHTML(source, 0, 0, {
pagesplit: true
},function(dispose){
pdf.save('test.pdf');
});
}
Please find a demo of the above scenario: https://plnkr.co/edit/6jNIu5c26ACeTPsfACX2?p=preview
, js html PDF? js PDF.
PS: html div, .