Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert to 203 DPI when no pdfOptions are specified; update CI tests #56

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .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.0.1
value: 5.0.2
validations:
required: true
- type: dropdown
Expand All @@ -33,7 +33,7 @@ body:
attributes:
label: OS version
description: Which operating system version was used?
placeholder: e.g. Windows 11 23H2, Ubuntu 23.10, macOS 14.1, Android 14, ...
placeholder: e.g. Windows 11 24H2, Ubuntu 24.04, macOS 14.5, Android 14, ...
validations:
required: false
- type: dropdown
Expand All @@ -58,6 +58,7 @@ body:
- .NET (Core)
- .NET Framework
- Mono
- Unity
- (Other)
default: 0
validations:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [windows-2019, windows-2022, ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14]
runs-on: ${{ matrix.os }}
if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_tests) == true
steps:
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>5.0.1</Version>
<Version>5.0.2</Version>
<Configurations>Debug;Release;ReleaseSigned</Configurations>
</PropertyGroup>

Expand Down
9 changes: 9 additions & 0 deletions PDFtoZPL/Conversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
if (pdfStream == null)
throw new ArgumentNullException(nameof(pdfStream));

if (pdfOptions == default)
pdfOptions = new PdfOptions();

// Stream ->PdfiumViewer.PdfDocument -> Image
var pdfBitmap = PDFtoImage.Conversion.ToImage(pdfStream, leaveOpen, password, page, pdfOptions);

Expand All @@ -109,7 +112,7 @@
[SupportedOSPlatform("macOS")]
[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)
{
if (pdfAsBase64String == null)
throw new ArgumentNullException(nameof(pdfAsBase64String));
Expand All @@ -134,7 +137,7 @@
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Android31.0")]
#endif
public static IEnumerable<string> ConvertPdf(byte[] pdfAsByteArray, string? password = null, PdfOptions pdfOptions = default, ZplOptions zplOptions = default)

Check warning on line 140 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)
{
if (pdfAsByteArray == null)
throw new ArgumentNullException(nameof(pdfAsByteArray));
Expand Down Expand Up @@ -168,6 +171,9 @@
if (pdfStream == null)
throw new ArgumentNullException(nameof(pdfStream));

if (pdfOptions == default)
pdfOptions = new PdfOptions();

// Stream ->PdfiumViewer.PdfDocument -> Image
foreach (var image in PDFtoImage.Conversion.ToImages(pdfStream, leaveOpen, password, pdfOptions))
{
Expand Down Expand Up @@ -253,6 +259,9 @@
if (pdfStream == null)
throw new ArgumentNullException(nameof(pdfStream));

if (pdfOptions == default)
pdfOptions = new PdfOptions();

// Stream -> PdfiumViewer.PdfDocument -> Image
await foreach (var image in PDFtoImage.Conversion.ToImagesAsync(pdfStream, leaveOpen, password, pdfOptions, cancellationToken))
{
Expand Down
6 changes: 2 additions & 4 deletions PDFtoZPL/PDFtoZPL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- NuGet -->
<PropertyGroup>
<VersionPrefix>5.0.1</VersionPrefix>
<VersionPrefix>5.0.2</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>David Sungaila</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand All @@ -21,9 +21,7 @@
<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>- Revert from 300 to 203 as default DPI. This is a breaking change.
- Replace PDFtoImage.RenderOptions with PDFtoZPL.PdfOptions. This is a breaking change.
- Fixed interactions between parameters Bounds and Width/Height.</PackageReleaseNotes>
<PackageReleaseNotes>- Revert from 300 to 203 as default DPI when no pdfOptions was specified. This is a breaking change.</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
18 changes: 9 additions & 9 deletions Tests/PdfConversionTests.cs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@

<!-- NuGet Icon -->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions WebConverter/WebConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyName>PDFtoZPL.WebConverter</AssemblyName>
<RootNamespace>PDFtoZPL.WebConverter</RootNamespace>
<StartupObject>PDFtoZPL.WebConverter.Program</StartupObject>
<VersionPrefix>5.0.1</VersionPrefix>
<VersionPrefix>5.0.2</VersionPrefix>
<VersionSuffix></VersionSuffix>
<RunAOTCompilation>true</RunAOTCompilation>
<WasmNativeStrip>true</WasmNativeStrip>
Expand Down Expand Up @@ -46,8 +46,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.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.6" PrivateAssets="all" />
<PackageReference Include="Thinktecture.Blazor.FileHandling" Version="2.0.0" />
<PackageReference Include="Thinktecture.Blazor.WebShare" Version="2.0.0" />
</ItemGroup>
Expand Down
Loading