1
0

Repository cleanup, Added art

This commit is contained in:
Michael Gordeev
2019-11-09 12:36:38 +03:00
parent bbcb6b179e
commit 22fb87a132
145 changed files with 16 additions and 14597 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();
}
}
}