I am new in angularjs and I'm trying to save my html modal into a PDF in angularjs. But it is saving only the current page on screen, it does not save the whole modal which is quite large.
I have tried on of the following code
<head>
<script src="angular.min.js"></script>
<script src="Angular/angular-animate.min.js"></script>
<script src="Angular/angular-aria.min.js"></script>
<script src="Angular/angular-material.min.js"></script>
<script src="Angular/angular-messages.min.js"></script>
<script src="jquery.min.js"></script>
<script src="moment.js"></script>
<script src="ui-bootstrap-tpls-0.10.0.js"></script>
<script src="AccordianController.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.22/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>
<script src="script.js"></script>
</head>
<body>
it contains the modal which is not shown here
</body>
Controller
$scope.pdf = function () {
html2canvas(document.getElementById('exportthis'), {
onrendered: function (canvas) {
var data = canvas.toDataURL();
var docDefinition = {
content: [{
image: data,
width: 500,
}]
};
pdfMake.createPdf(docDefinition).download("test.pdf");
}
});
}
My modal is large it will take almost 3 page, but here by this code I'm able to save only the screen which is shown.
Please suggest me any solution or which I can follow to achieve my requirement. Thanks In advence.