-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor HtmlToPdfConverter and update ReportSheetCache (#192)
* Refactor HtmlToPdfConverter and update ReportSheetCache * Move HtmlToPdfConverter to TournamentManager namespace * Add detailed logging and error handling in HtmlToPdfConverter * Add BrowserKind to set the kind of browser to use * Add ability to create PDF from html content or a file * Introduce DisplayMatchDate flag in ReportSheetCache * Modify IsOutdated to check DisplayMatchDate flag * Update Match constructor to include IServiceProvider * Update ReportSheet action to use _serviceProvider for ReportSheetCache * Updated ReportSheet.cshtml to conditionally display match date * Add html {-webkit-print-color-adjust: exact; } CSS to ReportSheet.cshtml (enables colored output for PDF) * Moved PuppeteerSharp package reference to TournamentManager.csproj * Added localization for English and German
- Loading branch information
Showing
7 changed files
with
119 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
TournamentManager/TournamentManager/HtmlToPdfConverter/BrowserKind.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// Copyright Volleyball League Project maintainers and contributors. | ||
// Licensed under the MIT license. | ||
// | ||
|
||
namespace TournamentManager.HtmlToPdfConverter; | ||
|
||
/// <summary> | ||
/// Specifies to kind of browser to use in <see cref="HtmlToPdfConverter"/>. | ||
/// </summary> | ||
public enum BrowserKind | ||
{ | ||
/// <summary>Chrome.</summary> | ||
Chrome, | ||
/// <summary>Firefox.</summary> | ||
Firefox, | ||
/// <summary>Chromium.</summary> | ||
Chromium, | ||
/// <summary>Chrome headless shell.</summary> | ||
ChromeHeadlessShell | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters