Skip to content

Commit

Permalink
Include pdfium for Blazor WebAssembly via NuGet
Browse files Browse the repository at this point in the history
  • Loading branch information
sungaila committed Jan 5, 2024
1 parent f2c8577 commit b78f580
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
30 changes: 17 additions & 13 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 @@ -80,25 +79,30 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net462' or '$(TargetFramework)'=='net481'">
<PackageReference Include="bblanchon.PDFium.Win32" Version="122.0.6219" PrivateAssets="analyzers" />
<PackageReference Include="SkiaSharp.NativeAssets.Win32" Version="2.88.6" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.Win32" Version="122.0.6219" />
<PackageReference Include="SkiaSharp.NativeAssets.Win32" Version="2.88.6" />
</ItemGroup>

<!-- .NET packages -->
<ItemGroup Condition="'$(TargetFramework)'=='net6.0' or '$(TargetFramework)'=='net7.0' or '$(TargetFramework)'=='net8.0'">
<PackageReference Include="bblanchon.PDFium.Linux" Version="122.0.6219" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.macOS" Version="122.0.6219" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.Win32" Version="122.0.6219" PrivateAssets="analyzers" />
<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" />
<PackageReference Include="bblanchon.PDFium.Linux" Version="122.0.6219" />
<PackageReference Include="bblanchon.PDFium.macOS" Version="122.0.6219" />
<PackageReference Include="bblanchon.PDFium.Win32" Version="122.0.6219" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.6" />
<PackageReference Include="SkiaSharp.NativeAssets.macOS" Version="2.88.6" />
<PackageReference Include="SkiaSharp.NativeAssets.Win32" Version="2.88.6" />
</ItemGroup>

<!-- Android packages -->
<ItemGroup Condition="'$(TargetFramework)'=='net7.0-android' or '$(TargetFramework)'=='net8.0-android' or '$(TargetFramework)'=='monoandroid10.0'">
<PackageReference Include="bblanchon.PDFium.Android" Version="122.0.6219" PrivateAssets="analyzers" />
<PackageReference Include="SkiaSharp.NativeAssets.Android" Version="2.88.6" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.Android" Version="122.0.6219" />
<PackageReference Include="SkiaSharp.NativeAssets.Android" Version="2.88.6" />
</ItemGroup>

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

<Import Project="PDFtoImage.PropertiesSigning.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 b78f580

Please sign in to comment.