diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index 3d2f1fce..2bcabdd0 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -38,8 +38,21 @@ jobs:
curl -L -o MiniPdf.Web/MiniPdf.Web.Client/wwwroot/fonts/NotoSansSC-Regular.ttf \
"https://github.com/google/fonts/raw/main/ofl/notosanssc/NotoSansSC%5Bwght%5D.ttf"
+ - name: Resolve MiniPdf NuGet version
+ id: minipdf-version
+ shell: pwsh
+ run: |
+ $index = Invoke-RestMethod 'https://api.nuget.org/v3-flatcontainer/minipdf/index.json'
+ $version = $index.versions |
+ Where-Object { $_ -notmatch '-' } |
+ Select-Object -Last 1
+ if (-not $version) {
+ throw 'Could not resolve the latest stable MiniPdf version from NuGet.'
+ }
+ "version=$version" >> $env:GITHUB_OUTPUT
+
- name: Publish Blazor WASM
- run: dotnet publish MiniPdf.Web/MiniPdf.Web.Client/MiniPdf.Web.Client.csproj -c Release -o publish
+ run: dotnet publish MiniPdf.Web/MiniPdf.Web.Client/MiniPdf.Web.Client.csproj -c Release -o publish -p:Version=${{ steps.minipdf-version.outputs.version }}
- name: Remove pre-compressed files (GitHub Pages does not support content negotiation)
run: find publish/wwwroot -name '*.br' -o -name '*.gz' | xargs rm -f
diff --git a/MiniPdf.Web/MiniPdf.Web.Client/Pages/Converter.razor b/MiniPdf.Web/MiniPdf.Web.Client/Pages/Converter.razor
index 5d898d5d..f585011a 100644
--- a/MiniPdf.Web/MiniPdf.Web.Client/Pages/Converter.razor
+++ b/MiniPdf.Web/MiniPdf.Web.Client/Pages/Converter.razor
@@ -25,6 +25,7 @@
@L.T("Subtitle") — @L.T("PoweredBy") MiniPdf
@@ -307,6 +308,13 @@ private const string ApiStatusUrl = ApiBaseUrl + "/api/status"; private const string ApiStatsUrl = ApiBaseUrl + "/api/stats"; private const string DefaultFontCacheKey = "NotoSansSC-Regular.ttf"; + private static readonly string MiniPdfVersion = + typeof(MiniSoftware.MiniPdf).Assembly + .GetCustomAttributes(typeof(System.Reflection.AssemblyInformationalVersionAttribute), false) + .OfType