You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/resolve-pdfium-issue.md
+42-7Lines changed: 42 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ documentation: ug
13
13
14
14
The issue, “The type initializer for 'Syncfusion.EJ2.PdfViewer.PdfiumNative' threw an exception” is due to the write access permission denied in the environment. The pdfium.dll will be created based on the operating system at the runtime. Due to the denial of permission, the pdfium.dll file couldn't have been created. So, copy the below x64 and x86 folders and paste them inside the folder into your project to resolve the issue or enable the write permission for that folder.
N> Use both the client and server-side of the same version in your project.
19
19
<br/> Ensure whether the pdfium.dll file is created in your project during runtime. Else, place the pdfium assemblies in any of the production environment locations and refer to the path by using the ReferencePath API.
@@ -27,7 +27,7 @@ N> Provide this path in the Load method of the PDFViewerController.cs
27
27
N> PdfRenderer PdfRenderer = new PdfRenderer();
28
28
<br/> PdfRenderer.ReferencePath = @"C:/";
29
29
30
-
## Steps to refer the Pdfium.dll
30
+
## Steps to refer the PDFium.dll
31
31
32
32
1. Extract the given file (Pdfium folder) and copy it in the sample’s root directory (parallel to Controllers folder)
33
33
@@ -40,10 +40,45 @@ N> You need to refer the ParentFolder up to the x64/x86 folder.
40
40
41
41
4. Build and publish the application.
42
42
43
-
Also, install only the package related to that OS, then build and run the project on that platform. For Windows, Linux, and OSX operating systems, use the following corresponding libraries:
43
+
Also, install the below package, then build and run the project. This will work on Windows, Linux, and OSX operating systems.
44
44
45
-
* Syncfusion.EJ2.PdfViewer.AspNet.Core.Linux
46
-
* Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows
47
-
* Syncfusion.EJ2.PdfViewer.AspNet.Core.OSX
45
+
* Syncfusion.EJ2.PdfViewer.AspNet.Core
48
46
49
-
Following these steps should resolve the issue.
47
+
Following these steps should resolve the issue.
48
+
49
+
## Steps to resolve the PDFium issue in Linux environment
50
+
51
+
* The issue, “The type initializer for ‘Syncfusion.EJ2.PdfViewer.PdfiumNative’ threw an exception” occurs due to the missing of pdfium dependency in the Linux environment. To resolve this, Execute the following commands one by one to install the pdfium dependency package in the Linux machine.
## Steps to resolve the PDFium issue in docker environment
60
+
61
+
* The issue, “The type initializer for ‘Syncfusion.EJ2.PdfViewer.PdfiumNative’ threw an exception” occurs due to the missing of pdfium dependency in the docker environment. Please follow the steps below to resolve this issue on docker environment.
62
+
63
+
64
+
If you are using the PDF Viewer with Docker in .NET 6.0 framework, please incorporate the following commands into your Dockerfile to install the pdfium dependency:
65
+
66
+
```
67
+
RUN ln -s /lib/x86_64-linux-gnu/libdl-2.24.so /lib/x86_64-linux-gnu/libdl.so
If you are using the PDF Viewer with Docker in .NET 8.0 framework, please incorporate the following commands into your Dockerfile to install the pdfium dependency:
76
+
77
+
```
78
+
RUN ln -s /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so
0 commit comments