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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

147460 Sep 11,2019 11:03 AM UTC Nov 27,2020 02:15 PM UTC WPF 5
loading
Tags: PdfViewer
Floris Verhoeven
Asked On September 11, 2019 11:03 AM UTC

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

Floris Verhoeven
Replied On 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

Aravindh Sathiyamoorthy [Syncfusion]
Replied On 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. 


Floris Verhoeven
Replied On 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


Aravindh Sathiyamoorthy [Syncfusion]
Replied On 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. 


Divya Dhayalan [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon