Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions HTML to PDF/Blink/HTML-deck-to-PDF/.NET/HTML_to_PDF_Core.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32819.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTML_to_PDF_Core", "HTML_to_PDF_Core\HTML_to_PDF_Core.csproj", "{80C225C3-E509-4E50-9B8D-4B4A306F2B99}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{80C225C3-E509-4E50-9B8D-4B4A306F2B99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80C225C3-E509-4E50-9B8D-4B4A306F2B99}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80C225C3-E509-4E50-9B8D-4B4A306F2B99}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80C225C3-E509-4E50-9B8D-4B4A306F2B99}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8C8703A4-0C63-43C3-BE6A-BFC5EA621BF7}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
using HTML_to_PDF_Core.Models;
using Microsoft.AspNetCore.Mvc;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Diagnostics;

namespace HTML_to_PDF_Core.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;

public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}

public IActionResult Index()
{
return View();
}

public IActionResult Privacy()
{
return View();
}

public IActionResult ExportToPDF()
{
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY");
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();

//Set Blink viewport size
blinkConverterSettings.ViewPortSize = new Syncfusion.Drawing.Size(1280, 0);
blinkConverterSettings.MediaType = MediaType.Print;
blinkConverterSettings.Css = @"@media print {

body {
overflow: visible !important;
height: auto !important;
}

.deck-container,
.slides {
display: block !important;
height: auto !important;
position: static !important;
}

.slide {
position: relative !important;
top: auto !important;
left: auto !important;
opacity: 1 !important;
visibility: visible !important;
display: block !important;
width: 100% !important;
min-height: 100vh !important;
page-break-after: always;
break-after: page;
}

.slide-content {
transform: none !important;
}

.controls,
.keyboard-hint,
.progress-line-container {
display: none !important;
}
}";
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;

string baseUrl = Path.GetFullPath("HtmlDeck");

string inputHtml = System.IO.File.ReadAllText(Path.Combine(baseUrl, "index1.html")); //use Index.html or index1.html (dec similar to PPT)

//Convert URL to PDF document
PdfDocument document = htmlConverter.Convert(inputHtml, baseUrl);

//Create memory stream
MemoryStream stream = new MemoryStream();

//Save the document to memory stream
document.Save(stream);
document.Close();

return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "HTML-to-PDF.pdf");
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Windows" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="HtmlDeck\Index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="HtmlDeck\index1.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="HtmlDeck\styles.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quarterly Business Review</title>

<!-- External CSS -->
<link rel="stylesheet" href="styles.css">
</head>
<body>

<!-- Slide 1 -->
<section class="slide">

<h1>Quarterly Business Review</h1>
<h2>FY26 Q2 Results</h2>
</section>

<!-- Slide 2 -->
<section class="slide">
<h1>Agenda</h1>

<ul>
<li>Business Overview</li>
<li>Revenue Performance</li>
<li>Customer Growth</li>
<li>Roadmap</li>
</ul>
</section>

<!-- Slide 3 -->
<section class="slide">
<h1>Revenue Growth</h1>

<table>
<thead>
<tr>
<th>Quarter</th>
<th>Revenue</th>
</tr>
</thead>

<tbody>
<tr>
<td>Q1</td>
<td>$1.2M</td>
</tr>
<tr>
<td>Q2</td>
<td>$1.8M</td>
</tr>
</tbody>
</table>
</section>

<!-- Slide 4 -->
<section class="slide">
<h1>Key Achievements</h1>

<ul>
<li>25% YoY revenue growth</li>
<li>50 new enterprise customers</li>
<li>99.9% platform uptime</li>
</ul>
</section>

<!-- Slide 5 -->
<section class="slide">
<h1>Thank You</h1>
<p>Questions &amp; Answers</p>
</section>

</body>
</html>
Loading
Loading