1
0

Updated Print and Save buttons on CV page

This commit is contained in:
Michael Gordeev
2019-10-17 16:14:06 +03:00
parent 4187decc0e
commit 3436237d31
7 changed files with 195 additions and 172 deletions
@@ -11,10 +11,18 @@ namespace MyWebsite.Controllers
public IActionResult Download()
{
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertUrl($"https://{Request.Host}/CV");
converter.Options.MarginTop = 25;
converter.Options.MarginBottom = 25;
PdfDocument doc = converter.ConvertUrl($"https://{Request.Host}/CV/PrintCV?pdfPreview=true");
byte[] data = doc.Save();
doc.Close();
return File(data, "application/pdf", "[Michael Gordeev] CV.pdf");
}
public IActionResult PrintCV(bool pdfPreview = false)
{
ViewData["pdfPreview"] = pdfPreview;
return View();
}
}
}