How can I retrieve my image drawn in my canvas tag on my Index.cshtml page in my Home Controller?
I can currently get the from them but not the value of to insert it into a PDF later
My index.cshtml
:
<form asp-action="Index">
<table>
<tr>
<th>Date</th>
<th>Société</th>
<th>Nom / Prénom</th>
<th>Signature (matin)</th>
<th>Signature (après-midi)</th>
</tr>
<tr>
<td><input asp-for="dateFormation" type="date" /></td>
<td><input asp-for="societeForme" type="text" /></td>
<td><input asp-for="nomPrenomForme" type="text" /></td>
<td><canvas id="signatureCanvas" width="200" height="100"></canvas></td>
<td><canvas id="signatureCanvas2" width="200" height="100"></canvas></td>
</tr>
</table>
@*BOUTON ENVOYER*@
<br />
<div class="myforma">
<button type="submit">Envoyer formulaire</button>
</div>
<br />
</form>
My HomeController.cs
:
public async Task<IActionResult> Index([Bind("dateFormation, societeForme, nomPrenomForme")] FormulaireModel formulaireModel)
{
var renderer = new HtmlToPdf();
var pdfCreate = renderer.RenderHtmlAsPdf(formulaireModel.typeFormation + " " + formulaireModel.dureeFormation + " " + formulaireModel.animateurFormation + " " + formulaireModel.dateFormation.ToShortDateString() + " " + formulaireModel.societeForme + " " + formulaireModel.nomPrenomForme);
pdfCreate.SaveAs("liste-presence.pdf");
return View();
}