-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for Mono Project * Change NuGet packages for target frameworks * Update NuGet * Fix Mono DllImport and add MonoConsole test * Update PATH in workflow
- Loading branch information
Showing
20 changed files
with
473 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net462;net471;net481</TargetFrameworks> | ||
<OutputType>Exe</OutputType> | ||
<Nullable>enable</Nullable> | ||
<AssemblyName>PDFtoImage.FrameworkTests.MonoConsole</AssemblyName> | ||
<RootNamespace>PDFtoImage.FrameworkTests.MonoConsole</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<!-- C# compiler --> | ||
<PropertyGroup> | ||
<LangVersion>latest</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<Features>strict</Features> | ||
<WarningsAsErrors>nullable</WarningsAsErrors> | ||
<NoWarn>CA1416</NoWarn> | ||
</PropertyGroup> | ||
|
||
<!-- Remove these libs when updating pdfium nuget packages --> | ||
<ItemGroup> | ||
<None Remove="linux-arm64\libpdfium.so" /> | ||
<None Remove="linux-x64\libpdfium.so" /> | ||
<None Remove="linux-x86\libpdfium.so" /> | ||
<None Remove="osx-x64\libpdfium.dylib" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="..\..\Tests\Assets\SocialPreview.pdf" Link="SocialPreview.pdf"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="linux-arm64\libpdfium.so"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
<TargetPath>arm64\libpdfium.so</TargetPath> | ||
</Content> | ||
<Content Include="linux-x64\libpdfium.so"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
<TargetPath>x64\libpdfium.so</TargetPath> | ||
</Content> | ||
<Content Include="linux-x86\libpdfium.so"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
<TargetPath>x86\libpdfium.so</TargetPath> | ||
</Content> | ||
<Content Include="osx-x64\libpdfium.dylib"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
<TargetPath>libpdfium.dylib</TargetPath> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\PDFtoImage\PDFtoImage.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace PDFtoImage.FrameworkTests.MonoConsole | ||
{ | ||
public class Program | ||
{ | ||
private const int ExpectedWidth = 5333; | ||
private const int ExpectedHeight = 2666; | ||
|
||
public static void Main() | ||
{ | ||
Directory.SetCurrentDirectory(Path.GetDirectoryName(typeof(Program).Assembly.Location)); | ||
using var input = new FileStream("SocialPreview.pdf", FileMode.Open, FileAccess.Read); | ||
using var bitmap = PDFtoImage.Conversion.ToImage(input); | ||
|
||
Console.WriteLine($"SocialPreview.pdf size: {bitmap.Width}x{bitmap.Height}"); | ||
|
||
if (ExpectedWidth != bitmap.Width || ExpectedHeight != bitmap.Height) | ||
throw new InvalidOperationException("Expected PDF width and height differ."); | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.