We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Cross plat: PDF to Image

We have a requirement where we run our backends across both Windows and Linux. Our developers also use a mix of Windows and Linux. 


We have a simple requirement: Convert PDF to images. 


The code we have works in Windows world. However we are not able to build a cross platform solution that works for both Linux and Windows. 


<PackageReference Include="Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows" Version="20.3.0.57"/>


We cannot swap this out for the Linux version as our .NET 7 backends require to run on both Windows and Linux. Is there any way that this can be done with Syncfusion?

Pdfium always causes issues with Syncfusion as it drives is crazy. 



On Linux:

System.TypeInitializationException: The type initializer for 'Syncfusion.EJ2.PdfViewer.PdfiumNative' threw an exception.

 ---> System.DllNotFoundException: Unable to load shared library 'kernel32' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:

/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.3/kernel32.so: cannot open shared object file: No such file or directory

/home/dylan/Projects/Common/CommonServices/CommonService.Media.Test/bin/Debug/net7.0/kernel32.so: cannot open shared object file: No such file or directory

/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.3/libkernel32.so: cannot open shared object file: No such file or directory

/home/dylan/Projects/Common/CommonServices/CommonService.Media.Test/bin/Debug/net7.0/libkernel32.so: cannot open shared object file: No such file or directory

/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.3/kernel32: cannot open shared object file: No such file or directory

/home/dylan/Projects/Common/CommonServices/CommonService.Media.Test/bin/Debug/net7.0/kernel32: cannot open shared object file: No such file or directory

/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.3/libkernel32: cannot open shared object file: No such file or directory

/home/dylan/Projects/Common/CommonServices/CommonService.Media.Test/bin/Debug/net7.0/libkernel32: cannot open shared object file: No such file or directory



3 Replies

CK Chinnamunia Karthik Chinna Thambi Syncfusion Team February 20, 2023 01:18 PM UTC

Refer the below link for how Install EJ2 PDF Viewer packages automatically based on the operating system.


https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/how-to/install-packages


Kindly check and lets us know if this is helpful.



DY Dylan February 20, 2023 06:43 PM UTC

I have read that link, thank you. 


However we cannot do different builds per platform. That defeats the purpose of having a cross-platform app. 


The requirement is the library is built once by using, and then at run time it must work across Linux and Windows. 



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team February 24, 2023 11:24 AM UTC

We have created a separate ticket in your name for the last query. Kindly follow this ticket for further updates on this.


Loader.
Live Chat Icon For mobile
Up arrow icon