Skip to content

Commit

Permalink
Include pdfium for Blazor WebAssembly via NuGet (#58)
Browse files Browse the repository at this point in the history
* Include pdfium for Blazor WebAssembly via NuGet

* Readd PrivateAssets="analyzers"

* Move github pages concurrency to publish job
  • Loading branch information
sungaila authored Jan 5, 2024
1 parent f2c8577 commit 7183aa6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/githubpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ on:
push:
branches:
- 'master'

concurrency:
group: "pages"
cancel-in-progress: false

-
jobs:
publish:
name: Publish
Expand Down Expand Up @@ -82,6 +78,10 @@ jobs:
needs: publish
runs-on: ubuntu-latest

concurrency:
group: "pages"
cancel-in-progress: false

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/githubpages_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
pull_request:
branches:
- '**'

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
publish:
Expand Down Expand Up @@ -91,6 +87,10 @@ jobs:
environment:
name: github-pages-staging
url: ${{ steps.deployment.outputs.page_url }}

concurrency:
group: "pages"
cancel-in-progress: false

steps:
- name: Deploy to GitHub Pages
Expand Down
12 changes: 8 additions & 4 deletions src/PDFtoImage/PDFtoImage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
<PackageProjectUrl>https://github.com/sungaila/PDFtoImage</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/sungaila/PDFtoImage/master/etc/Icon_128.png</PackageIconUrl>
<Description>A .NET library to render PDF files into images.</Description>
<PackageReleaseNotes>- Added optional parameter antiAliasing.
- Added optional parameter backgroundColor.</PackageReleaseNotes>
<PackageReleaseNotes>- Added PDFium binaries for ASP.NET Core Blazor WebAssembly.</PackageReleaseNotes>
<PackageTags>PDF Bitmap Image Convert Conversion C# PDFium SkiaSharp Skia PNG JPG JPEG WEBP Xamarin Android MonoAndroid MAUI wasm WebAssembly</PackageTags>
<RepositoryUrl>https://github.com/sungaila/PDFtoImage.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down Expand Up @@ -76,7 +75,7 @@

<!-- .NET Framework packages -->
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" PrivateAssets="analyzers" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net462' or '$(TargetFramework)'=='net481'">
Expand All @@ -92,7 +91,6 @@
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.6" PrivateAssets="analyzers" />
<PackageReference Include="SkiaSharp.NativeAssets.macOS" Version="2.88.6" PrivateAssets="analyzers" />
<PackageReference Include="SkiaSharp.NativeAssets.Win32" Version="2.88.6" PrivateAssets="analyzers" />
<PackageReference Include="SkiaSharp.NativeAssets.WebAssembly" Version="2.88.6" PrivateAssets="analyzers" />
</ItemGroup>

<!-- Android packages -->
Expand All @@ -101,6 +99,12 @@
<PackageReference Include="SkiaSharp.NativeAssets.Android" Version="2.88.6" PrivateAssets="analyzers" />
</ItemGroup>

<!-- Blazor WebAssembly stuff -->
<ItemGroup Condition="'$(TargetFramework)'=='net7.0' or '$(TargetFramework)'=='net8.0'">
<PackageReference Include="SkiaSharp.NativeAssets.WebAssembly" Version="2.88.6" PrivateAssets="analyzers" />
<PackageReference Include="Sungaila.PDFium.BlazorWebAssembly" Version="122.0.6229" PrivateAssets="analyzers" />
</ItemGroup>

<Import Project="PDFtoImage.PropertiesSigning.targets" />
<Import Project="PDFtoImage.CodeSigning.targets" />
<Import Project="PDFtoImage.PackageSigning.targets" />
Expand Down
3 changes: 0 additions & 3 deletions src/WebConverter/WebConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<VersionSuffix></VersionSuffix>
<RunAOTCompilation>true</RunAOTCompilation>
<WasmNativeStrip>true</WasmNativeStrip>
<WasmEnableSIMD>true</WasmEnableSIMD>
<WasmEnableExceptionHandling>false</WasmEnableExceptionHandling>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>partial</TrimMode>
</PropertyGroup>
Expand Down Expand Up @@ -61,7 +59,6 @@
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
<Content Update="wwwroot\404.html" CopyToOutputDirectory="Always" />
<EmbeddedResource Include="..\..\README.md" Link="README.md" />
<NativeFileReference Include="pdfium.a" />
<NativeFileReference Include="$(SkiaSharpStaticLibraryPath)\3.1.12\simd\libSkiaSharp.a" />
</ItemGroup>

Expand Down
Binary file removed src/WebConverter/pdfium.a
Binary file not shown.

0 comments on commit 7183aa6

Please sign in to comment.