Hello I want to add tab and a new line in my pdf file Is there any way to add tab and newline in this code when displaying in pdf file? Please help. Thank You. Really Appreciate it. Below is my code.
JAVASCRIPT
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>PDF</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js"></script>
</head>
<body>
<!-- Content Area -->
<div id="print">
<p></p>
<p id="veewom"></p>
</div>
<div id="p-btn"></div>
<button id="download">Print</button>
<!-- Script -->
<script>
var doc = new jsPDF();
var specialElementHandlers = {
'#p-btn': function (element, renderer) {
return true;
}
};
$('#download').click(function () {
var fieldId = "field100";
var chars = $('#try1').val();
var chars1 = $('#try2').val();
var chars2 = $('#try3').val();
$('#veewom').html(
'<b>' + "One" + ':</b>' + chars + '<br>' +
'<b>' + "Two" + ':</b>' + chars1 + '<br>' +
'<b>' + "Three" + ':</b>' + chars2
);
var d3 = $('[name=' + fieldId + ']:enabled').val();
diff1 = "";
if (d3) {
diff = d3;
}
var source = $('#print').html();
doc.fromHTML(source, 15, 15, {
'width': 170,
'elementHandlers': specialElementHandlers
});
doc.save('pdf-version.pdf');
});
</script>
</body>
</html>
Here is the image. I want to add new line and tab spaces in it.
]1