Skip to content

Commit

Permalink
Update NuGet packages (#96)
Browse files Browse the repository at this point in the history
* Update NuGet packages

* Set version to 4.1.1

* Add SaveOutputInGeneratedFolder.runsettings

* Fix P/Invoke
  • Loading branch information
sungaila authored Sep 20, 2024
1 parent 65d71eb commit 49db048
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: PDFtoImage version
description: Which version of PDFtoImage is affected?
value: 4.1.0
value: 4.1.1
validations:
required: true
- type: dropdown
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ jobs:
7.x
8.x
- name: Download test project MonoConsole
if: success() || failure()
uses: actions/download-artifact@main
with:
name: MonoConsole
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyName>PDFtoImage.Console</AssemblyName>
<RootNamespace>PDFtoImage.Console</RootNamespace>
<StartupObject>PDFtoImage.Console.Program</StartupObject>
<Version>4.1.0</Version>
<Version>4.1.1</Version>
<Configurations>Debug;Release;ReleaseSigned</Configurations>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/FrameworkTests/MauiApp/MauiApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.90" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.90" />
</ItemGroup>

<ItemGroup>
Expand Down
23 changes: 4 additions & 19 deletions src/PDFtoImage/Internals/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ public static IntPtr FPDFBitmap_CreateEx(int width, int height, FPDFBitmap forma
}
}

public static void FPDFBitmap_FillRect(IntPtr bitmapHandle, int left, int top, int width, int height, uint color)
public static bool FPDFBitmap_FillRect(IntPtr bitmapHandle, int left, int top, int width, int height, uint color)
{
lock (LockString)
{
Imports.FPDFBitmap_FillRect(bitmapHandle, left, top, width, height, color);
return Imports.FPDFBitmap_FillRect(bitmapHandle, left, top, width, height, color) != 0;
}
}

Expand All @@ -182,14 +182,6 @@ public static void FPDFBitmap_Destroy(IntPtr bitmapHandle)
}
}

public static uint FPDFDest_GetDestPageIndex(IntPtr document, IntPtr dest)
{
lock (LockString)
{
return Imports.FPDFDest_GetDestPageIndex(document, dest);
}
}

/// <summary>
/// Opens a document using a .NET Stream. Allows opening huge
/// PDFs without loading them into memory first.
Expand Down Expand Up @@ -354,16 +346,12 @@ private static partial class Imports

[LibraryImport("pdfium")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial void FPDFBitmap_FillRect(IntPtr bitmapHandle, int left, int top, int width, int height, uint color);
public static partial int FPDFBitmap_FillRect(IntPtr bitmapHandle, int left, int top, int width, int height, uint color);

[LibraryImport("pdfium")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial void FPDFBitmap_Destroy(IntPtr bitmapHandle);

[LibraryImport("pdfium")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial uint FPDFDest_GetDestPageIndex(IntPtr document, IntPtr dest);

[LibraryImport("pdfium")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial uint FPDF_GetLastError();
Expand Down Expand Up @@ -442,14 +430,11 @@ private static partial class Imports
public static extern IntPtr FPDFBitmap_CreateEx(int width, int height, int format, IntPtr first_scan, int stride);

[DllImport("pdfium", CallingConvention = CallingConvention.Cdecl)]
public static extern void FPDFBitmap_FillRect(IntPtr bitmapHandle, int left, int top, int width, int height, uint color);
public static extern int FPDFBitmap_FillRect(IntPtr bitmapHandle, int left, int top, int width, int height, uint color);

[DllImport("pdfium", CallingConvention = CallingConvention.Cdecl)]
public static extern void FPDFBitmap_Destroy(IntPtr bitmapHandle);

[DllImport("pdfium", CallingConvention = CallingConvention.Cdecl)]
public static extern uint FPDFDest_GetDestPageIndex(IntPtr document, IntPtr dest);

[DllImport("pdfium", CallingConvention = CallingConvention.Cdecl)]
public static extern uint FPDF_GetLastError();

Expand Down
16 changes: 7 additions & 9 deletions src/PDFtoImage/PDFtoImage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<!-- NuGet -->
<PropertyGroup>
<VersionPrefix>4.1.0</VersionPrefix>
<VersionPrefix>4.1.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>David Sungaila</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand All @@ -23,9 +23,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 System.Index for single page conversion.
- Added System.Range for multiple page conversion.
- Added IEnumerable&lt;int&gt; for multiple page conversion.</PackageReleaseNotes>
<PackageReleaseNotes>- Fixed DllNotFoundException for WebAssembly.</PackageReleaseNotes>
<PackageTags>PDF Bitmap Image Convert Conversion C# PDFium SkiaSharp Skia PNG JPG JPEG WEBP Xamarin Android MAUI wasm WebAssembly</PackageTags>
<RepositoryUrl>https://github.com/sungaila/PDFtoImage.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down Expand Up @@ -76,9 +74,9 @@

<!-- Shared packages -->
<ItemGroup Condition="'$(TargetFramework)'!='net8.0-android'">
<PackageReference Include="bblanchon.PDFium.Linux" Version="128.0.6569" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.macOS" Version="128.0.6569" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.Win32" Version="128.0.6569" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.Linux" Version="130.0.6721" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.macOS" Version="130.0.6721" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.Win32" Version="130.0.6721" PrivateAssets="analyzers" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8" PrivateAssets="analyzers" />
<PackageReference Include="SkiaSharp.NativeAssets.macOS" Version="2.88.8" PrivateAssets="analyzers" />
<PackageReference Include="SkiaSharp.NativeAssets.Win32" Version="2.88.8" PrivateAssets="analyzers" />
Expand All @@ -97,14 +95,14 @@

<!-- Android packages -->
<ItemGroup Condition="'$(TargetFramework)'=='net8.0-android'">
<PackageReference Include="bblanchon.PDFium.Android" Version="128.0.6569" PrivateAssets="analyzers" />
<PackageReference Include="bblanchon.PDFium.Android" Version="130.0.6721" PrivateAssets="analyzers" />
<PackageReference Include="SkiaSharp.NativeAssets.Android" Version="2.88.8" PrivateAssets="analyzers" />
</ItemGroup>

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

<Import Project="PDFtoImage.PropertiesSigning.targets" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 13 additions & 3 deletions src/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,25 @@
</ContentWithTargetPath>
</ItemGroup>

<ItemGroup>
<None Remove="SaveOutputInGeneratedFolder.runsettings" />
</ItemGroup>

<ItemGroup>
<Content Include="SaveOutputInGeneratedFolder.runsettings">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<!-- Project references -->
<ItemGroup>
<ProjectReference Include="..\PDFtoImage\PDFtoImage.csproj" />
</ItemGroup>

<!-- NuGet Icon -->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
</ItemGroup>
</Project>
7 changes: 3 additions & 4 deletions src/WebConverter/WebConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyName>PDFtoImage.WebConverter</AssemblyName>
<RootNamespace>PDFtoImage.WebConverter</RootNamespace>
<StartupObject>PDFtoImage.WebConverter.Program</StartupObject>
<VersionPrefix>4.1.0</VersionPrefix>
<VersionPrefix>4.1.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<RunAOTCompilation>true</RunAOTCompilation>
<WasmNativeStrip>true</WasmNativeStrip>
Expand Down Expand Up @@ -40,8 +40,8 @@
<ItemGroup>
<PackageReference Include="ByteSize" Version="2.1.2" />
<PackageReference Include="Markdig.Signed" Version="0.37.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.8" PrivateAssets="all" />
<PackageReference Include="Thinktecture.Blazor.FileHandling" Version="2.0.0" />
<PackageReference Include="Thinktecture.Blazor.WebShare" Version="2.0.0" />
</ItemGroup>
Expand All @@ -54,6 +54,5 @@
<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="$(SkiaSharpStaticLibraryPath)\3.1.12\simd\libSkiaSharp.a" />
</ItemGroup>
</Project>

0 comments on commit 49db048

Please sign in to comment.