Skip to content

Commit

Permalink
Revert to 203 DPI when no pdfOptions are specified; update CI tests (#56
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sungaila authored Jun 26, 2024
1 parent 0bfa5f9 commit 21c4197
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 23 deletions.
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 @@ public static string ConvertPdfPage(Stream pdfStream, bool leaveOpen = false, st
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 Down Expand Up @@ -168,6 +171,9 @@ public static IEnumerable<string> ConvertPdf(Stream pdfStream, bool leaveOpen =
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 @@ public static async IAsyncEnumerable<string> ConvertPdfAsync(Stream pdfStream, b
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

0 comments on commit 21c4197

Please sign in to comment.