“html to pdf jquery” Ответ

html to pdf jquery

var pdf = new jsPDF('p', 'pt', 'a4');
pdf.addHTML($("#sectionId").get(0), 15, 15, options, function () {
  pdf.save('@(Html.Raw("textdoc.pdf")'));
  return true;
});
Micheal Robbie

html table to pdf jquery

<body>

	<div id="printThis">
		<div class="container">
			<br><br>
			<center>lorem</center>
			<center>
				<table>
					<tr>
						<th>Id</th>
						<th>Name</th>
						<th>someth</th>
						<th>woring</th>
					</tr>
					<tr>
						<td>1</td>
						<td>jerry</td>
						<td>Account</td>
						<td>berlin</td>
					</tr>
					<tr>
						<td>1</td>
						<td>jerry</td>
						<td>Account</td>
						<td>berlin</td>
					</tr>
				</table>
			</center>
		</div>
	</div>

<center>
	<input type="submit" value="Print" id="PrintBtn"  name="">
</center>
    <script>
    
     $('#printBtn').click(function () {
            var openWindow = window.open("", "", "_blank");
            openWindow.document.write($('#printThis').parent().html());
            openWindow.document.write('<style>' + $('style').html() + '</style>');
            openWindow.document.close();
            openWindow.focus();
            openWindow.print();
            // openWindow.close();
            setTimeout(function () {
                openWindow.close();
            }, 1000)

        })
    </script>

</body>
Lu Yote Mar

Ответы похожие на “html to pdf jquery”

Вопросы похожие на “html to pdf jquery”

Больше похожих ответов на “html to pdf jquery” по HTML

Смотреть популярные ответы по языку

Смотреть другие языки программирования