Skip to content

Commit

Permalink
Release 1.4.1 with fix for #11 (#12)
Browse files Browse the repository at this point in the history
* Release 1.4.1 with fix for #11

* Removed PackageLicenseFile, PackageLicenseExpression should be enough
  • Loading branch information
sandrohanea authored Sep 11, 2023
1 parent 825e61a commit 5fd27b0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
13 changes: 9 additions & 4 deletions PdfiumPrinter/LibraryLoader/NativeLibraryLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,15 @@ _ when RuntimeInformation.IsOSPlatform(OSPlatform.OSX) => ("osx", "libpdfium.dyl
Path.GetDirectoryName(Environment.GetCommandLineArgs()[0])
}.Where(it => !string.IsNullOrEmpty(it)).FirstOrDefault();

path = string.IsNullOrEmpty(assemblySearchPath)
? Path.Combine("runtimes", $"{platform}-{architecture}", fileName)
: Path.Combine(assemblySearchPath, "runtimes", $"{platform}-{architecture}", "native", fileName);
var isNetFramework = RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework");

path = isNetFramework switch
{
true when string.IsNullOrEmpty(assemblySearchPath) => Path.Combine(architecture, fileName),
true => Path.Combine(assemblySearchPath, architecture, fileName),
false when string.IsNullOrEmpty(assemblySearchPath) => Path.Combine("runtimes", $"{platform}-{architecture}", "native", fileName),
_ => Path.Combine(assemblySearchPath, "runtimes", $"{platform}-{architecture}", "native", fileName)
};
}

if (defaultLibraryLoader != null)
Expand All @@ -81,7 +86,7 @@ _ when RuntimeInformation.IsOSPlatform(OSPlatform.OSX) => ("osx", "libpdfium.dyl
if (!File.Exists(path))
{
throw new FileNotFoundException($"Native Library not found in path {path}. " +
$"Verify you have have included the native Pdfium library in your application, " +
$"Verify you have included the native Pdfium library in your application, " +
$"or install the default libraries with the bblanchon.PDFium NuGet.");
}

Expand Down
10 changes: 8 additions & 2 deletions PdfiumPrinter/PdfiumPrinter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>PdfiumPrinter</AssemblyName>
<RootNamespace>PdfiumPrinter</RootNamespace>
<LangVersion>10</LangVersion>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Description>This package can help you to print or render pdfs using netstandard and pdfium.</Description>
<Authors>Sandro Hanea</Authors>
<Company />
Expand All @@ -14,9 +14,15 @@
<RepositoryUrl>https://github.com/sandrohanea/PdfiumPrinter</RepositoryUrl>
<RepositoryType>GIT</RepositoryType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\LICENSE" Pack="true" PackagePath="" />
<None Include="..\readme.md" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To install PdfiumPrinter, run the following command in the [Package Manager Cons

or simply add a package reference in your csproj:
```
<PackageReference Include="PdfiumPrinter" Version="1.4.0" />
<PackageReference Include="PdfiumPrinter" Version="1.4.1" />
```


Expand Down

0 comments on commit 5fd27b0

Please sign in to comment.