Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor PDF generation using a new HtmlToPdfConverter #191

Merged
merged 2 commits into from
Sep 28, 2024

Commits on Sep 28, 2024

  1. Rename "Chromium" to "Browser" in config and code

    * Updated AppSettings.json to rename "Chromium" section to "Browser" for PDF generation.
    * Reflected this change across multiple files including ReportSheetCacheTests.cs, UnitTestHelpers.cs, and ReportSheetCache.cs.
    * Updated comments in ReportSheet.cshtml accordingly.
    * Simplified AppSettings.json by removing comments about `AllowedUserNameCharacters` and `DefaultLockoutTimeSpan` settings.
    axunonb committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    8884848 View commit details
    Browse the repository at this point in the history
  2. Refactor PDF generation

    Refactor PDF generation
    
    * Updated README.md to reflect the correct Chromium version and added a note about rendering issues with Chromium 131.x.
    * Simplified the `EnsureCacheFolder` method in `ReportSheetCache.cs` by removing unnecessary directory existence checks and creation logic.
    * Added a new `HtmlToPdfConverter` class in `HtmlToPdfConverter.cs` to encapsulate the logic for converting HTML to PDF using either Puppeteer or a browser command line.
    * Refactored the `GetOrCreatePdf` method in `ReportSheetCache.cs` to use a new `HtmlToPdfConverter` class for generating PDF data, replacing the previous Puppeteer and browser command line logic.
    * Removed the `GetReportSheetBrowser`, `MovePdfToCache`, `GetReportSheetPuppeteer`, `CreateReportSheetPdfBrowser`, `CreateHtmlFile`, and `DeleteTempPathFolder` methods from `ReportSheetCache.cs` as they are now handled by the new `HtmlToPdfConverter` class.
    * Updated the `ReportSheet` action in `Match.cs` to use the new PDF generation logic.
    * Updated the Bootstrap CSS link in `ReportSheet.cshtml` to a newer version and adjusted the print styles accordingly.
    axunonb committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    7ff7185 View commit details
    Browse the repository at this point in the history