'Syncfusion.PdfToImageConverter.PdfiumNative' threw an exception

I'm using Syncfusion.Blazor.Grid and Syncfusion.PdfToImageConvert.Net packages. I installed the SkiaSharp.NativeAssests.Linux and the  SkiaSharp.NativeAssests.Linux.NoDepndencies packages per your documentation. Everything works when testing in a windows environment but once I deploy to a docker container and try to convert an to an image from a pdf I get this error in the browser console:


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

 ---> System.DllNotFoundException: Unable to load shared library 'libdl' 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:

/app/runtimes/linux-x64/native/libdl.so: cannot open shared object file: No such file or directory

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

/app/libdl.so: cannot open shared object file: No such file or directory

/app/runtimes/linux-x64/native/liblibdl.so: cannot open shared object file: No such file or directory

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

/app/liblibdl.so: cannot open shared object file: No such file or directory

/app/runtimes/linux-x64/native/libdl: cannot open shared object file: No such file or directory

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

/app/libdl: cannot open shared object file: No such file or directory

/app/runtimes/linux-x64/native/liblibdl: cannot open shared object file: No such file or directory

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

/app/liblibdl: cannot open shared object file: No such file or directory


   at Syncfusion.PdfToImageConverter.PdfiumNative.dlopen(String fileName, Int32 flags)

   at Syncfusion.PdfToImageConverter.PdfiumNative..cctor()

   --- End of inner exception stack trace ---

   at Syncfusion.PdfToImageConverter.PdfiumNative.FPDF_InitLibrary()

   at Syncfusion.PdfToImageConverter.PdfiumViewer.FPDF_InitLibrary()

   at Syncfusion.PdfToImageConverter.PdfToImageConverter.CreatePdfiumDocument(Stream stream, String password)

   at Syncfusion.PdfToImageConverter.PdfToImageConverter.Load(Stream stream, String password)

   at Syncfusion.PdfToImageConverter.PdfToImageConverter.Load(Stream stream)

   at CertificationManager.Components.AttachmentsComponent.Submit() in /src/CertificationManager/Components/AttachmentsComponent.razor:line 130

   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

   at MudBlazor.MudBaseButton.OnClickHandler(MouseEventArgs ev)

   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

  

Is there another package that I missed?


1 Reply

YM Yathavakrishnan Mohan Syncfusion Team January 31, 2025 03:40 PM UTC

Hi Eric,

Based on the provided stack trace, the issue occurred because the libdl.so file was not found in the Docker container.

 

The libdl.so file name can vary based on the Docker base image. To determine the correct libdl.so file name, run your web service sample in the local and find the libdl.so file in the specified location, as shown in the provided screenshot

 

Screenshot 1:

 

 

 

Screenshot 2:

 

 

 

Note: In the below command is suitable for the above screenshot, we can copy the libdl.so.2 and rename libdl.so. Adjust the command accordingly if the libdl.so file name in your sample is different.

 

 

 

If you have any concerns, Please share the following details. This information will assist us in further analyzing the problem and providing you with the necessary details.

 

  • Share the Linux version details.
  • Share the docker file details.




Loader.
Up arrow icon