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

Pdfium.dll not found after packaging WPF application into APPX/MSIX bundle

Hello,

I've encountered an issue while using the PdfDocumentView control in our WPF project. Everything works fine, untill the project is packaged for sideloading. When running the application after sideloading, the exception 'DLL Pdfium.dll is not found' is thrown. I've attached a sample project with the complete flow to reproduce this issue.

- A WPF project, with a simple screen that has the pdf viewer control, it loads a PDF file in the Loaded event. Can be run locally and works just fine.
- A packaging project, that creates a sideloadeable packages from the WPF project. A new package can be created by right-clicking the packaging project, and under store, click 'Create App Packages'.
- In the provided sample, there are already generated packages that can be sideloaded right-away, look under 'PdfTest.Packaging\AppPackages'
- To install the existing packages, you will also need to locally install the certificate file, which is in the same directory.

Only after sideloading the package, the issue with the Pdfium.dll appears.

I would kindly like to request some assistance with this matter. 

Kind regards,

Floris


Attachment: WordTestApp_e62e8ed1.zip

5 Replies

FV Floris Verhoeven September 11, 2019 11:05 AM UTC

I'm sorry but my previous post, contained the wrong sample project. Please find the correct one attached to this post.

Attachment: PdfTest_685bd073.zip


AS Aravindh Sathiyamoorthy Syncfusion Team September 12, 2019 06:46 PM UTC

Hi Floris, 
 
Thanks for contacting Syncfusion. 
 
We have checked the provided sample and it seems working fine as expected at our end without any exception. We have also shared the video for the same and that can be downloaded from the below link, 
 
 
But we suspect that this issue may occur due to read-only permission in the application deployed location, where pdfium.dll will be created. Since pdfium.dll is created at the run time (and not generated from Nuget.org) in the application deployed location, this requires write permission. So, could you please check whether the application deployed location folder has proper write permission, or you can run the application from the folder which has write permission. You can also set the reference path in PdfViewerControl to create the pdfium.dll in the provided location. The code snippet for the same is given below, 
 
PdfViewer.ReferencePath = @"C:\Pdfium"; 
 
Also, could you please confirm the product version to us? This help us to investigate further and provide you with better solution. 
 
Regards, 
Aravindh Sathiyamoorthy. 



FV Floris Verhoeven September 17, 2019 06:31 PM UTC

Hello,

I'm using the same version as installed in the sample application. As I've said, it runs fine when running it through Visual Studio. The problem only happens with the packaged version of the application.

- In the provided sample, there are already generated packages that can be sideloaded right-away, look under 'PdfTest.Packaging\AppPackages'
- To install the existing packages, you will also need to locally install the certificate file, which is in the same directory.
- To install the package, double click the MSIXBUNDLE file

Kind regards,

Floris



AS Aravindh Sathiyamoorthy Syncfusion Team September 18, 2019 05:37 PM UTC

Hi Floris, 

We are working on the issue that you reported. Meanwhile, kindly share the following details to analyze more on this issue and assist you with the better solution 

1.       Visual Studio version. 
2.       Windows OS details. 
3.       System language/Culture Information 
  
Regards,
Aravindh Sathiyamoorthy. 



DD Divya Dhayalan Syncfusion Team November 27, 2020 02:15 PM UTC

  
Hi Floris, 
  
We would like to follow up on this to know whether the Reference Path suggestion which is provided in our previous update works for you. Also, please try the following things to overcome the issue when working with MSIX bundle / packages. 
    
Solution 1 (which is already provided in our previous update):  As we mentioned earlier, we can give the custom path for PDFium folder in which the write permission is granted by setting the ReferencePath property.  We tried this in the sample which you have shared in the previous update and it work well for us. We also created a video for the same and it can be downloaded from the below link: https://www.syncfusion.com/downloads/support/forum/147460/ze/PdfViewerReferencePath100319722 
 
Solution 2: From the 16.3 versions, you need to add the below code snippet in the sample level to change the rendering engine to use SfPdf rendering engine as well as avoid generating Pdfium dlls in the application folder.  
 
PdfDocumetView pdfDocumentView = new PdfDocumentView();    
pdfDocumentView.RenderingEngine = Syncfusion.Windows.PdfViewer.PdfRenderingEngine.SfPdf;    
pdfDocumentView.Load("Sample.pdf"); 
 
Regards, 
Divya 


Loader.
Live Chat Icon For mobile
Up arrow icon