I know this is late, but I have a solution for this, you can do this in two ways: -
First you can use the built-in "line" option to draw a line under your text: -
doc.line(x-from,y-from,x-to,y-to);
Second, you can display the text in html, and then use the option to print html in your jspdf configuration, for example: -
<div id="disptext">
<div class="underText">Hello</div>
</div>
<br/>
<input type='button' value='download' id='downP' />
<style>
.underText { text-decoration: underline;}
</style>
<script>
$(document).ready(function() {
$('#downP').on('click', function() {
var pdf = new jsPDF('p', 'pt', 'a4');
pdf.addHTML($('#disptext')[0], function() {
pdf.save('text.pdf');
});
});
});
</script>
source
share