1
0

CV Download and print options updates

This commit is contained in:
Michael Gordeev
2019-10-15 21:54:37 +03:00
parent 8ff09db5de
commit 4187decc0e
6 changed files with 35 additions and 17 deletions
@@ -1,5 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using System.Net;
using SelectPdf;
namespace MyWebsite.Controllers
{
@@ -10,7 +10,10 @@ namespace MyWebsite.Controllers
public IActionResult Download()
{
byte[] data = new WebClient().DownloadData($"https://{Request.Host}/CV.pdf");
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertUrl($"https://{Request.Host}/CV");
byte[] data = doc.Save();
doc.Close();
return File(data, "application/pdf", "[Michael Gordeev] CV.pdf");
}
}
@@ -10,6 +10,7 @@ namespace MyWebsite.Controllers
// TODO: Create custom error page
// TODO: Update Projects.json and Gallery.json
// TODO: Complete About page
// TODO: Add resume file
public IActionResult Index() =>
View();