Skip to content

Commit

Permalink
Update to PDFtoImage 5.0.0-preview (#65)
Browse files Browse the repository at this point in the history
* Update to PDFtoImage 5.0.0-preview

* Remove DEMANGLE_SUPPORT
  • Loading branch information
sungaila authored Oct 18, 2024
1 parent 69930a4 commit 553d36d
Show file tree
Hide file tree
Showing 22 changed files with 352 additions and 46 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: PDFtoZPL version
description: Which version of PDFtoZPL is affected?
value: 5.3.1
value: 6.0.0
validations:
required: true
- type: dropdown
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ jobs:
with:
dotnet-version: |
6.x
7.x
8.x
9.x
dotnet-quality: 'ga'
- name: Setup .NET workload maui-android
run: dotnet workload install maui-android
- name: Setup .NET workload maui-ios
run: dotnet workload install maui-ios
- name: Setup .NET workload wasm-tools
run: dotnet workload install wasm-tools
- name: Restore
Expand All @@ -73,6 +76,7 @@ jobs:
- name: Pack
run: dotnet pack PDFtoZPL/PDFtoZPL.csproj -c ${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }} -p:VersionSuffix=ci --no-restore
- name: Generate artifact attestation
if: github.repository == 'sungaila/PDFtoImage' && github.ref == 'refs/heads/master'
uses: actions/attest-build-provenance@main
with:
subject-path: PDFtoZPL/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }}/*.nupkg
Expand Down Expand Up @@ -108,7 +112,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022, ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14]
os: [windows-2019, windows-2022, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-12, macos-13, macos-14, macos-15]
runs-on: ${{ matrix.os }}
if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_tests) == true
steps:
Expand All @@ -117,9 +121,11 @@ jobs:
with:
dotnet-version: |
6.x
7.x
8.x
9.x
dotnet-quality: 'ga'
- name: Download test assemblies
if: (success() || failure())
uses: actions/download-artifact@main
with:
name: Test assemblies
Expand All @@ -135,12 +141,12 @@ jobs:
- name: .NET 6
if: success() || failure()
run: dotnet test net6.0/*.Tests.dll --logger trx --verbosity detailed
- name: .NET 7
if: success() || failure()
run: dotnet test net7.0/*.Tests.dll --logger trx --verbosity detailed
- name: .NET 8
if: success() || failure()
run: dotnet test net8.0/*.Tests.dll --logger trx --verbosity detailed
- name: .NET 9
if: success() || failure()
run: dotnet test net9.0/*.Tests.dll --logger trx --verbosity detailed
- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@main
Expand Down Expand Up @@ -199,14 +205,15 @@ jobs:
with:
dotnet-version: |
6.x
7.x
8.x
9.x
dotnet-quality: 'ga'
- name: Setup .NET workload maui-android
run: dotnet workload install maui-android
- name: Setup .NET workload maui-ios
run: dotnet workload install maui-ios
- name: Setup dotnet-coverage
run: dotnet tool install --global dotnet-coverage
- name: Setup .NET workload android
run: dotnet workload install android
- name: Setup JDK 17
uses: actions/setup-java@main
with:
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/githubpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@main
Expand All @@ -20,9 +20,12 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
dotnet-version: 8.x
dotnet-version: 9.x
dotnet-quality: 'ga'
- name: Setup .NET workload maui-android
run: dotnet workload install maui-android
- name: Setup .NET workload maui-ios
run: dotnet workload install maui-ios
- name: Setup .NET workload wasm-tools
run: dotnet workload install wasm-tools
- name: Update relative paths
Expand All @@ -38,9 +41,9 @@ jobs:
- name: Publish
run: dotnet publish WebConverter/WebConverter.csproj -c Release -p:PublishProfile=WebConverter/Properties/PublishProfiles/PublishSite.pubxml -p:VersionSuffix=ci --no-restore
- name: Create .nojekyll file
run: touch WebConverter/bin/Release/net8.0/publish/wwwroot/.nojekyll
run: touch WebConverter/bin/Release/net9.0/publish/wwwroot/.nojekyll
- name: Update service-worker-assets.js hashes
working-directory: WebConverter/bin/Release/net8.0/publish/wwwroot
working-directory: WebConverter/bin/Release/net9.0/publish/wwwroot
if: false
run: |
jsFile=$(<service-worker-assets.js)
Expand Down Expand Up @@ -72,7 +75,7 @@ jobs:
- name: Upload pages artifact
uses: actions/upload-pages-artifact@main
with:
path: WebConverter/bin/Release/net8.0/publish/wwwroot
path: WebConverter/bin/Release/net9.0/publish/wwwroot
deploy:
name: Deploy
needs: publish
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/githubpages_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@main
Expand All @@ -21,9 +21,12 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
dotnet-version: 8.x
dotnet-version: 9.x
dotnet-quality: 'ga'
- name: Setup .NET workload maui-android
run: dotnet workload install maui-android
- name: Setup .NET workload maui-ios
run: dotnet workload install maui-ios
- name: Setup .NET workload wasm-tools
run: dotnet workload install wasm-tools
- name: Update relative paths
Expand All @@ -39,9 +42,9 @@ jobs:
- name: Publish
run: dotnet publish WebConverter/WebConverter.csproj -c Release -p:PublishProfile=WebConverter/Properties/PublishProfiles/PublishSite.pubxml -p:VersionSuffix=ci --no-restore
- name: Create .nojekyll file
run: touch WebConverter/bin/Release/net8.0/publish/wwwroot/.nojekyll
run: touch WebConverter/bin/Release/net9.0/publish/wwwroot/.nojekyll
- name: Update service-worker-assets.js hashes
working-directory: WebConverter/bin/Release/net8.0/publish/wwwroot
working-directory: WebConverter/bin/Release/net9.0/publish/wwwroot
if: false
run: |
jsFile=$(<service-worker-assets.js)
Expand Down Expand Up @@ -73,7 +76,7 @@ jobs:
- name: Upload pages artifact
uses: actions/upload-pages-artifact@main
with:
path: WebConverter/bin/Release/net8.0/publish/wwwroot
path: WebConverter/bin/Release/net9.0/publish/wwwroot
deploy:
name: Deploy
needs: publish
Expand All @@ -97,4 +100,4 @@ jobs:
id: deployment
uses: actions/deploy-pages@main
with:
preview: true
preview: true
4 changes: 2 additions & 2 deletions Console/Console.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Assembly -->
<PropertyGroup>
<TargetFrameworks>net462;net481;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;net481;net6.0;net8.0;net9.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<AssemblyName>PDFtoZPL.Console</AssemblyName>
<RootNamespace>PDFtoZPL.Console</RootNamespace>
<StartupObject>PDFtoZPL.Console.Program</StartupObject>
<Version>5.3.1</Version>
<Version>6.0.0</Version>
<Configurations>Debug;Release;ReleaseSigned</Configurations>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Console/Properties/PublishProfiles/DotNet.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>ReleaseSigned</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Publish\net8.0\</PublishDir>
<PublishDir>bin\Publish\net9.0\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions PDFtoZPL/Conversion.Deprecated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static partial class Conversion
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
[Obsolete("This method is deprecated and will be removed in a future release. Use SaveJpeg with a System.Index instead.")]
#endif
Expand All @@ -50,6 +51,7 @@ public static string ConvertPdfPage(string pdfAsBase64String, string? password =
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
[Obsolete("This method is deprecated and will be removed in a future release. Use SaveJpeg with a System.Index instead.")]
#endif
Expand Down Expand Up @@ -78,6 +80,7 @@ public static string ConvertPdfPage(byte[] pdfAsByteArray, string? password = nu
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
[Obsolete("This method is deprecated and will be removed in a future release. Use SaveJpeg with a System.Index instead.")]
#endif
Expand Down
9 changes: 9 additions & 0 deletions PDFtoZPL/Conversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static partial class Conversion
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
public static string ConvertPdfPage(string pdfAsBase64String, Index page, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default)
{
Expand All @@ -52,6 +53,7 @@ public static string ConvertPdfPage(string pdfAsBase64String, Index page, string
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
public static string ConvertPdfPage(byte[] pdfAsByteArray, Index page, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default)
{
Expand All @@ -77,6 +79,7 @@ public static string ConvertPdfPage(byte[] pdfAsByteArray, Index page, string? p
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
public static string ConvertPdfPage(Stream pdfStream, Index page, bool leaveOpen = false, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default)
{
Expand Down Expand Up @@ -106,6 +109,7 @@ public static string ConvertPdfPage(Stream pdfStream, Index page, bool leaveOpen
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
#endif
public static IEnumerable<string> ConvertPdf(string pdfAsBase64String, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default)

Check warning on line 115 in PDFtoZPL/Conversion.cs

View workflow job for this annotation

GitHub Actions / SonarCloud

Split this method into two, one handling parameters check and the other handling the iterator. (https://rules.sonarsource.com/csharp/RSPEC-4456)
Expand All @@ -131,6 +135,7 @@ public static IEnumerable<string> ConvertPdf(string pdfAsBase64String, string? p
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
#endif
public static IEnumerable<string> ConvertPdf(byte[] pdfAsByteArray, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default)

Check warning on line 141 in PDFtoZPL/Conversion.cs

View workflow job for this annotation

GitHub Actions / SonarCloud

Split this method into two, one handling parameters check and the other handling the iterator. (https://rules.sonarsource.com/csharp/RSPEC-4456)
Expand Down Expand Up @@ -160,6 +165,7 @@ public static IEnumerable<string> ConvertPdf(byte[] pdfAsByteArray, string? pass
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
#endif
public static IEnumerable<string> ConvertPdf(Stream pdfStream, bool leaveOpen = false, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default)
Expand Down Expand Up @@ -192,6 +198,7 @@ public static IEnumerable<string> ConvertPdf(Stream pdfStream, bool leaveOpen =
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
#endif
public static async IAsyncEnumerable<string> ConvertPdfAsync(string pdfAsBase64String, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default, [EnumeratorCancellation] CancellationToken cancellationToken = default)
Expand All @@ -218,6 +225,7 @@ public static async IAsyncEnumerable<string> ConvertPdfAsync(string pdfAsBase64S
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
#endif
public static async IAsyncEnumerable<string> ConvertPdfAsync(byte[] pdfAsByteArray, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default, [EnumeratorCancellation] CancellationToken cancellationToken = default)
Expand Down Expand Up @@ -248,6 +256,7 @@ public static async IAsyncEnumerable<string> ConvertPdfAsync(byte[] pdfAsByteArr
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("iOS13.6")]
[SupportedOSPlatform("Android31.0")]
#endif
public static async IAsyncEnumerable<string> ConvertPdfAsync(Stream pdfStream, bool leaveOpen = false, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default, [EnumeratorCancellation] CancellationToken cancellationToken = default)
Expand Down
13 changes: 8 additions & 5 deletions PDFtoZPL/PDFtoZPL.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Assembly -->
<PropertyGroup>
<TargetFrameworks>net462;net471;net481;net6.0;net7.0;net8.0;net8.0-android;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;net471;net481;net6.0;net8.0;net8.0-android;net8.0-ios;net9.0;net9.0-android;net9.0-ios;netstandard2.0</TargetFrameworks>
<AssemblyName>PDFtoZPL</AssemblyName>
<RootNamespace>PDFtoZPL</RootNamespace>
<EmbedAllSources>true</EmbedAllSources>
Expand All @@ -12,16 +12,19 @@

<!-- NuGet -->
<PropertyGroup>
<VersionPrefix>5.3.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionPrefix>6.0.0</VersionPrefix>
<VersionSuffix>preview</VersionSuffix>
<Authors>David Sungaila</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>Icon_128.png</PackageIcon>
<PackageProjectUrl>https://github.com/sungaila/PDFtoZPL</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/sungaila/PDFtoZPL/master/Icon_128.png</PackageIconUrl>
<Description>A .NET library to convert PDF files (and bitmaps) into Zebra Programming Language code.</Description>
<PackageReleaseNotes>- Fixed DllNotFoundException for WebAssembly.</PackageReleaseNotes>
<PackageReleaseNotes>- Add .NET 9 as TargetFramework.
- Add iOS as TargetFramework.
- Remove .NET 7 as TargetFramework.
- Remove MonoAndroid/Xamarin as TargetFramework.</PackageReleaseNotes>
<PackageTags>PDF ZPL Zebra Bitmap Convert Conversion C# PDFium MAUI wasm WebAssembly</PackageTags>
<RepositoryUrl>https://github.com/sungaila/PDFtoZPL.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down Expand Up @@ -66,7 +69,7 @@

<!-- SourceLink build steps and NuGet packages -->
<ItemGroup>
<PackageReference Include="PDFtoImage" Version="4.1.1" PrivateAssets="analyzers" />
<PackageReference Include="PDFtoImage" Version="5.0.0-preview" PrivateAssets="analyzers" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="SharpZipLib" Version="1.4.2" PrivateAssets="analyzers" />
</ItemGroup>
Expand Down
Loading

0 comments on commit 553d36d

Please sign in to comment.