CV Download and print options updates
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Net;
|
using SelectPdf;
|
||||||
|
|
||||||
namespace MyWebsite.Controllers
|
namespace MyWebsite.Controllers
|
||||||
{
|
{
|
||||||
@@ -10,7 +10,10 @@ namespace MyWebsite.Controllers
|
|||||||
|
|
||||||
public IActionResult Download()
|
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");
|
return File(data, "application/pdf", "[Michael Gordeev] CV.pdf");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace MyWebsite.Controllers
|
|||||||
// TODO: Create custom error page
|
// TODO: Create custom error page
|
||||||
// TODO: Update Projects.json and Gallery.json
|
// TODO: Update Projects.json and Gallery.json
|
||||||
// TODO: Complete About page
|
// TODO: Complete About page
|
||||||
|
// TODO: Add resume file
|
||||||
public IActionResult Index() =>
|
public IActionResult Index() =>
|
||||||
View();
|
View();
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,9 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.9" />
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
|
||||||
|
<PackageReference Include="Select.HtmlToPdf.NetCore" Version="19.1.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,21 +1,12 @@
|
|||||||
using System;
|
using Microsoft.AspNetCore;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore;
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace MyWebsite
|
namespace MyWebsite
|
||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args) =>
|
||||||
{
|
|
||||||
CreateWebHostBuilder(args).Build().Run();
|
CreateWebHostBuilder(args).Build().Run();
|
||||||
}
|
|
||||||
|
|
||||||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
|
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
|
||||||
WebHost.CreateDefaultBuilder(args)
|
WebHost.CreateDefaultBuilder(args)
|
||||||
|
|||||||
@@ -5,10 +5,11 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
<h1>My resume</h1>
|
<h1>My resume</h1>
|
||||||
<a class="comment" asp-action="Download">// Download CV (.pdf) </a>
|
<a class="comment" asp-action="Download">// Download CV (.pdf) </a><br />
|
||||||
|
<a class="comment" onclick="PrintCV()">// Print CV </a>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<article>
|
<article id="cv">
|
||||||
<h3>Michael (Mikhail) A. Gordeev</h3>
|
<h3>Michael (Mikhail) A. Gordeev</h3>
|
||||||
<hr>
|
<hr>
|
||||||
<p>
|
<p>
|
||||||
@@ -16,6 +17,7 @@
|
|||||||
Russia<br>
|
Russia<br>
|
||||||
Phone (Russia): +7 (996) 929-19-69<br>
|
Phone (Russia): +7 (996) 929-19-69<br>
|
||||||
Email: <a href="mailto:michael.xfox@outlook.com">michael.xfox@outlook.com</a><br>
|
Email: <a href="mailto:michael.xfox@outlook.com">michael.xfox@outlook.com</a><br>
|
||||||
|
Personal Website: <a href="//xfox111.net/" target="_blank">https://www.xfox111.net/</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h4>Overall Summary:</h4>
|
<h4>Overall Summary:</h4>
|
||||||
@@ -74,6 +76,9 @@
|
|||||||
<li>
|
<li>
|
||||||
Database: MySQL, Microsoft Access
|
Database: MySQL, Microsoft Access
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
English knowledge: C1 (Advanced )
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Very energetic and ready to take new challenges
|
Very energetic and ready to take new challenges
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -68,4 +68,21 @@ function UpdateProjects()
|
|||||||
desc.innerText = "";
|
desc.innerText = "";
|
||||||
desc.innerHTML = text;
|
desc.innerHTML = text;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function PrintCV() {
|
||||||
|
var printFrame = window.open("", "", "height=500, width=800");
|
||||||
|
|
||||||
|
printFrame.document.write("<html>");
|
||||||
|
printFrame.document.write(document.head.outerHTML);
|
||||||
|
printFrame.document.write("<body>");
|
||||||
|
printFrame.document.write(document.getElementById("cv").outerHTML);
|
||||||
|
printFrame.document.write("</body>");
|
||||||
|
printFrame.document.write("</html>");
|
||||||
|
|
||||||
|
printFrame.document.close();
|
||||||
|
setTimeout(function () {
|
||||||
|
printFrame.print();
|
||||||
|
printFrame.close();
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user