diff --git a/MyWebsite/MyWebsite/Controllers/CVController.cs b/MyWebsite/MyWebsite/Controllers/CVController.cs index 125ce6a..aceb9a5 100644 --- a/MyWebsite/MyWebsite/Controllers/CVController.cs +++ b/MyWebsite/MyWebsite/Controllers/CVController.cs @@ -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"); } } diff --git a/MyWebsite/MyWebsite/Controllers/HomeController.cs b/MyWebsite/MyWebsite/Controllers/HomeController.cs index f34a170..69c139e 100644 --- a/MyWebsite/MyWebsite/Controllers/HomeController.cs +++ b/MyWebsite/MyWebsite/Controllers/HomeController.cs @@ -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(); diff --git a/MyWebsite/MyWebsite/MyWebsite.csproj b/MyWebsite/MyWebsite/MyWebsite.csproj index 2e347bc..0f7ded5 100644 --- a/MyWebsite/MyWebsite/MyWebsite.csproj +++ b/MyWebsite/MyWebsite/MyWebsite.csproj @@ -6,8 +6,9 @@ - - + + + diff --git a/MyWebsite/MyWebsite/Program.cs b/MyWebsite/MyWebsite/Program.cs index 54d353b..46c009f 100644 --- a/MyWebsite/MyWebsite/Program.cs +++ b/MyWebsite/MyWebsite/Program.cs @@ -1,21 +1,12 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; namespace MyWebsite { public class Program { - public static void Main(string[] args) - { + public static void Main(string[] args) => CreateWebHostBuilder(args).Build().Run(); - } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) diff --git a/MyWebsite/MyWebsite/Views/CV/Index.cshtml b/MyWebsite/MyWebsite/Views/CV/Index.cshtml index 3e7dd12..d43361d 100644 --- a/MyWebsite/MyWebsite/Views/CV/Index.cshtml +++ b/MyWebsite/MyWebsite/Views/CV/Index.cshtml @@ -5,10 +5,11 @@

My resume

- // Download CV (.pdf)  + // Download CV (.pdf) 
+ // Print CV 
-
+

Michael (Mikhail) A. Gordeev


@@ -16,6 +17,7 @@ Russia
Phone (Russia): +7 (996) 929-19-69
Email: michael.xfox@outlook.com
+ Personal Website: https://www.xfox111.net/

Overall Summary:

@@ -74,6 +76,9 @@
  • Database: MySQL, Microsoft Access
  • +
  • + English knowledge: C1 (Advanced ) +
  • Very energetic and ready to take new challenges
  • diff --git a/MyWebsite/MyWebsite/wwwroot/js/site.js b/MyWebsite/MyWebsite/wwwroot/js/site.js index 3fa586b..4a3b120 100644 --- a/MyWebsite/MyWebsite/wwwroot/js/site.js +++ b/MyWebsite/MyWebsite/wwwroot/js/site.js @@ -68,4 +68,21 @@ function UpdateProjects() desc.innerText = ""; desc.innerHTML = text; } +} + +function PrintCV() { + var printFrame = window.open("", "", "height=500, width=800"); + + printFrame.document.write(""); + printFrame.document.write(document.head.outerHTML); + printFrame.document.write(""); + printFrame.document.write(document.getElementById("cv").outerHTML); + printFrame.document.write(""); + printFrame.document.write(""); + + printFrame.document.close(); + setTimeout(function () { + printFrame.print(); + printFrame.close(); + }, 500); } \ No newline at end of file