Skip to content

Commit

Permalink
Update to PDFtoImage 3.1.0 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
sungaila authored Jan 29, 2024
1 parent 7bead73 commit 10d0b1b
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 50 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: 4.0.0
value: 4.1.0
validations:
required: true
- type: dropdown
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,20 @@ jobs:
java-version: 17
java-package: jdk
distribution: 'zulu'
- name: Setup Android SDK 29
run: C:\Android\android-sdk\cmdline-tools\latest\bin\sdkmanager "platforms;android-29"
- name: Setup Windows 11 SDK (10.0.22621.0)
uses: GuillaumeFalourd/setup-windows10-sdk-action@main
with:
sdk-version: 22621
- name: Restore
run: dotnet restore PDFtoZPL.sln
run: msbuild PDFtoZPL.Build.slnf /t:restore
- name: Build
run: msbuild PDFtoZPL.sln /p:Configuration=${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }} /p:VersionSuffix=ci /p:RestorePackages=false
run: msbuild PDFtoZPL.Build.slnf /p:Configuration=${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }} /p:VersionSuffix=ci /p:RestorePackages=false
- name: Pack
run: msbuild PDFtoZPL/PDFtoZPL.csproj /t:pack /p:Configuration=${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }} /p:VersionSuffix=ci /p:RestorePackages=false
- name: Publish libraries
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: Library assemblies
path: |
Expand All @@ -93,15 +99,15 @@ jobs:
!**/*.snupkg
if-no-files-found: error
- name: Publish NuGet packages
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: NuGet packages
path: |
PDFtoZPL/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }}/*.nupkg
PDFtoZPL/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }}/*.snupkg
if-no-files-found: error
- name: Publish tests
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_tests) == true
with:
name: Test assemblies
Expand Down Expand Up @@ -131,12 +137,15 @@ jobs:
with:
dotnet-version: 8.x
- name: Download test assemblies
uses: actions/download-artifact@main
uses: actions/download-artifact@v4
with:
name: Test assemblies
- name: .NET Framework 4.6.2
if: runner.os == 'Windows' && success()
run: dotnet test net462/*.Tests.dll --logger trx --verbosity detailed
- name: .NET Framework 4.7.1
if: runner.os == 'Windows' && (success() || failure())
run: dotnet test net471/*.Tests.dll --logger trx --verbosity detailed
- name: .NET Framework 4.8.1
if: runner.os == 'Windows' && (success() || failure())
run: dotnet test net481/*.Tests.dll --logger trx --verbosity detailed
Expand All @@ -151,10 +160,11 @@ jobs:
run: dotnet test net8.0/*.Tests.dll --logger trx --verbosity detailed
- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: Test results (${{ matrix.os }})
path: ./**/*.trx
if-no-files-found: error
retention-days: 1
publish-test-results:
name: Publish tests results
Expand All @@ -169,8 +179,10 @@ jobs:
if: (success() || failure()) && (github.event_name != 'workflow_dispatch' && true || inputs.publish_testresults) == true
steps:
- name: Download Artifacts
uses: actions/download-artifact@main
uses: actions/download-artifact@v4
with:
pattern: Test results (*)
merge-multiple: true
path: artifacts
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@master
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/githubpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
sed -i 's/"action": "\/"/"action": "\/${{github.event.repository.name}}\/"/g' manifest.webmanifest
sed -i 's/"action": "\/receive-webshare"/"action": "\/${{github.event.repository.name}}\/receive-webshare"/g' manifest.webmanifest
- name: Restore
run: dotnet restore PDFtoZPL.sln
run: dotnet restore WebConverter/WebConverter.csproj
- 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
Expand Down Expand Up @@ -78,6 +78,10 @@ jobs:
needs: publish
runs-on: ubuntu-latest

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

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
Expand All @@ -87,10 +91,6 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

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

steps:
- name: Deploy to GitHub Pages
id: deployment
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 @@ -35,7 +35,7 @@ jobs:
sed -i 's/"action": "\/"/"action": "\/${{github.event.repository.name}}\/"/g' manifest.webmanifest
sed -i 's/"action": "\/receive-webshare"/"action": "\/${{github.event.repository.name}}\/receive-webshare"/g' manifest.webmanifest
- name: Restore
run: dotnet restore PDFtoZPL.sln
run: dotnet restore WebConverter/WebConverter.csproj
- 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
Expand Down Expand Up @@ -87,11 +87,11 @@ jobs:
environment:
name: github-pages-staging
url: ${{ steps.deployment.outputs.page_url }}

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

cancel-in-progress: true
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
2 changes: 1 addition & 1 deletion Console/Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>PDFtoZPL.Console</AssemblyName>
<RootNamespace>PDFtoZPL.Console</RootNamespace>
<StartupObject>PDFtoZPL.Console.Program</StartupObject>
<Version>4.0.0</Version>
<Version>4.1.0</Version>
<Configurations>Debug;Release;ReleaseSigned</Configurations>
</PropertyGroup>

Expand Down
11 changes: 11 additions & 0 deletions PDFtoZPL.Build.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"solution": {
"path": "PDFtoZPL.sln",
"projects": [
"Console\\Console.csproj",
"PDFtoZPL\\PDFtoZPL.csproj",
"Tests\\Tests.csproj",
"WebConverter\\WebConverter.csproj"
]
}
}
20 changes: 7 additions & 13 deletions PDFtoZPL/PDFtoZPL.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.44">
<!-- Assembly -->
<PropertyGroup>
<TargetFrameworks>net462;net481;net6.0;net7.0;net7.0-android;net8.0;net8.0-android;monoandroid10.0</TargetFrameworks>
<TargetFrameworks>net462;net471;net481;net6.0;net7.0;net7.0-android;net8.0;net8.0-android;monoandroid10.0;netstandard2.0</TargetFrameworks>
<AssemblyName>PDFtoZPL</AssemblyName>
<RootNamespace>PDFtoZPL</RootNamespace>
<EmbedAllSources>true</EmbedAllSources>
Expand All @@ -12,7 +12,7 @@

<!-- NuGet -->
<PropertyGroup>
<VersionPrefix>4.0.0</VersionPrefix>
<VersionPrefix>4.1.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>David Sungaila</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand All @@ -21,7 +21,9 @@
<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>- Added PDFium binaries for ASP.NET Core Blazor WebAssembly.</PackageReleaseNotes>
<PackageReleaseNotes>- Added support for Mono.
- Added support for Unity.
- Added support for UWP.</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,19 +68,11 @@

<!-- SourceLink build steps and NuGet packages -->
<ItemGroup>
<PackageReference Include="PDFtoImage" Version="3.0.0" PrivateAssets="analyzers" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PDFtoImage" Version="3.1.0" PrivateAssets="analyzers" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="SharpZipLib" Version="1.4.2" PrivateAssets="analyzers" />
</ItemGroup>

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

<Import Project="PDFtoZPL.PropertiesSigning.targets" />
<Import Project="PDFtoZPL.CodeSigning.targets" />
<Import Project="PDFtoZPL.PackageSigning.targets" />
Expand Down
24 changes: 24 additions & 0 deletions PDFtoZPL/PublicAPI/net471/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#nullable enable
PDFtoZPL.Conversion
static PDFtoZPL.Conversion.ConvertBitmap(byte[]! bitmapAsByteArray, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool setLabelLength = false, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None) -> string!
static PDFtoZPL.Conversion.ConvertBitmap(string! bitmapPath, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool setLabelLength = false, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None) -> string!
static PDFtoZPL.Conversion.ConvertBitmap(System.IO.Stream! bitmapAsStream, bool leaveOpen, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool setLabelLength = false, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None) -> string!
static PDFtoZPL.Conversion.ConvertBitmap(System.IO.Stream! bitmapAsStream, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool setLabelLength = false, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None) -> string!
static PDFtoZPL.Conversion.ConvertBitmap(SkiaSharp.SKBitmap! bitmap, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool setLabelLength = false, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None) -> string!
static PDFtoZPL.Conversion.ConvertPdf(byte[]! pdfAsByteArray, string? password = null, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PDFtoImage.PdfRotation rotation = PDFtoImage.PdfRotation.Rotate0, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None, PDFtoImage.PdfAntiAliasing antiAliasing = PDFtoImage.PdfAntiAliasing.All, SkiaSharp.SKColor? backgroundColor = null) -> System.Collections.Generic.IEnumerable<string!>!
static PDFtoZPL.Conversion.ConvertPdf(string! pdfAsBase64String, string? password = null, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PDFtoImage.PdfRotation rotation = PDFtoImage.PdfRotation.Rotate0, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None, PDFtoImage.PdfAntiAliasing antiAliasing = PDFtoImage.PdfAntiAliasing.All, SkiaSharp.SKColor? backgroundColor = null) -> System.Collections.Generic.IEnumerable<string!>!
static PDFtoZPL.Conversion.ConvertPdf(System.IO.Stream! pdfStream, bool leaveOpen, string? password = null, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PDFtoImage.PdfRotation rotation = PDFtoImage.PdfRotation.Rotate0, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None, PDFtoImage.PdfAntiAliasing antiAliasing = PDFtoImage.PdfAntiAliasing.All, SkiaSharp.SKColor? backgroundColor = null) -> System.Collections.Generic.IEnumerable<string!>!
static PDFtoZPL.Conversion.ConvertPdf(System.IO.Stream! pdfStream, string? password = null, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PDFtoImage.PdfRotation rotation = PDFtoImage.PdfRotation.Rotate0, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None, PDFtoImage.PdfAntiAliasing antiAliasing = PDFtoImage.PdfAntiAliasing.All, SkiaSharp.SKColor? backgroundColor = null) -> System.Collections.Generic.IEnumerable<string!>!
static PDFtoZPL.Conversion.ConvertPdfPage(byte[]! pdfAsByteArray, string? password = null, int page = 0, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PDFtoImage.PdfRotation rotation = PDFtoImage.PdfRotation.Rotate0, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None, PDFtoImage.PdfAntiAliasing antiAliasing = PDFtoImage.PdfAntiAliasing.All, SkiaSharp.SKColor? backgroundColor = null) -> string!
static PDFtoZPL.Conversion.ConvertPdfPage(string! pdfAsBase64String, string? password = null, int page = 0, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PDFtoImage.PdfRotation rotation = PDFtoImage.PdfRotation.Rotate0, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None, PDFtoImage.PdfAntiAliasing antiAliasing = PDFtoImage.PdfAntiAliasing.All, SkiaSharp.SKColor? backgroundColor = null) -> string!
static PDFtoZPL.Conversion.ConvertPdfPage(System.IO.Stream! pdfStream, bool leaveOpen, string? password = null, int page = 0, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PDFtoImage.PdfRotation rotation = PDFtoImage.PdfRotation.Rotate0, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None, PDFtoImage.PdfAntiAliasing antiAliasing = PDFtoImage.PdfAntiAliasing.All, SkiaSharp.SKColor? backgroundColor = null) -> string!
static PDFtoZPL.Conversion.ConvertPdfPage(System.IO.Stream! pdfStream, string? password = null, int page = 0, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, PDFtoZPL.Conversion.BitmapEncodingKind encodingKind = PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PDFtoImage.PdfRotation rotation = PDFtoImage.PdfRotation.Rotate0, byte threshold = 128, PDFtoZPL.Conversion.DitheringKind ditheringKind = PDFtoZPL.Conversion.DitheringKind.None, PDFtoImage.PdfAntiAliasing antiAliasing = PDFtoImage.PdfAntiAliasing.All, SkiaSharp.SKColor? backgroundColor = null) -> string!
PDFtoZPL.Conversion.BitmapEncodingKind
PDFtoZPL.Conversion.BitmapEncodingKind.Hexadecimal = 0 -> PDFtoZPL.Conversion.BitmapEncodingKind
PDFtoZPL.Conversion.BitmapEncodingKind.HexadecimalCompressed = 1 -> PDFtoZPL.Conversion.BitmapEncodingKind
PDFtoZPL.Conversion.BitmapEncodingKind.Base64 = 2 -> PDFtoZPL.Conversion.BitmapEncodingKind
PDFtoZPL.Conversion.BitmapEncodingKind.Base64Compressed = 3 -> PDFtoZPL.Conversion.BitmapEncodingKind
PDFtoZPL.Conversion.DitheringKind
PDFtoZPL.Conversion.DitheringKind.Atkinson = 2 -> PDFtoZPL.Conversion.DitheringKind
PDFtoZPL.Conversion.DitheringKind.FloydSteinberg = 1 -> PDFtoZPL.Conversion.DitheringKind
PDFtoZPL.Conversion.DitheringKind.None = 0 -> PDFtoZPL.Conversion.DitheringKind
1 change: 1 addition & 0 deletions PDFtoZPL/PublicAPI/net471/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Loading

0 comments on commit 10d0b1b

Please sign in to comment.