1
0

Refactoring 1

This commit is contained in:
Michael Gordeev
2019-12-09 21:14:09 +03:00
parent 7f57d9cc95
commit 53e95afa2d
115 changed files with 934 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Mvc;
using SelectPdf;
namespace MyWebsite.Controllers
{
public class CVController : Controller
{
public IActionResult Index() =>
View();
public IActionResult Download()
{
HtmlToPdf converter = new HtmlToPdf();
converter.Options.MarginTop = 25;
converter.Options.MarginBottom = 25;
PdfDocument doc = converter.ConvertUrl($"{Request.Scheme}://{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();
}
}
}