im using dom-to-image and filesaver to convert html to image but i dont know how to add custom text as footer before generate the image.
This is my code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.min.js"></script>
<script src="https://cdn.jsdelivr.net/g/filesaver.js"></script>
<style>
.test{
width:300px;
height:300px;
border:1px solid #ddd;
}
</style>
<body>
<button class="btn btn-success" id="button">Save Image</button>
<div id="test" class="test">
abcd
</div>
<script>
$(document).ready(function(){
$("#button").click(function(){
domtoimage.toBlob(document.getElementById("test"))
.then(function(blob){
window.saveAs(blob,"output.png");
});
});
});
</script>
</body>
