I'm trying to create web application that consisting an
- editable cshtml view page
and then
- save that edited content as a PDF once I click the button
So this is the whole cshtml view page ,
@model IEnumerable<int>
@{
ViewBag.Title = "Create Template";
}
<!DOCTYPE html>
<html>
<head>
<title>Create a Template</title>
</head>
<body>
<div id='template'>
<h1 contentEditable='True'>Product Name</h1>
<div >
<h2 contentEditable='True'>Product Description</h2>
<p contentEditable='True'>London is the capital city of England.</p>
</div>
</div>
<button id="btn_sumbit" type="button" class="btn btn-danger submit">Save as PDF</button>
</body>
</html>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/jqueryui")
<script type="text/javascript">
$('#btn_sumbit').on('click', function () {
var div_value = document.getElementById('template').innerHTML;
RazorPDF.PdfResult(div_value, "PDF");
});
</script>
}
I'm using RazorPDF to do this task , but once I click this button it doesn't saving to PDF
I can edit this cshtml view page , I want to save that finally edited content as pdf (which is dynamic view)