Reputation: 347
For the application that I am making, I need to make use of the Pdfiumviewer package, which in turn requires you to add Pdfium itself, which is made available by Google. There is a "tutorial" on how to add pdfium on the official site but I haven't been able to decipher what exactly it is that I need to do.
At first glance, it appeared that you can get Pdfium via de Nuget Package Manager but it quickly became apparent that nuget doesn't add the actual dll to the project, and simply adding it as a reference doesn't work either. (throws 'reference could not be added' error). After this, I attempted to move the Pdfium dll to the bin/debug folder, but that still gives the same error. After doing some research, I found out that this dll is not supported by visual studio and you have to build/integrate it using the command line.
There are instructions on how to achieve this provided on https://pdfium.googlesource.com/pdfium/ https://github.com/pvginkel/PdfiumViewer/wiki/Building-PDFium
but after a few days of reading into it, I still have no clue what exactly I should and shouldn't do in the tutorial provided by google.
Therefor, I would like to kindly ask if anyone is either able to explain in plain English how to run through these steps, or if anyone knows a more user friendly tutorial to follow.
Upvotes: 19
Views: 31668
Reputation: 191
follow this steps
<ItemGroup>
<None Include="$(USERPROFILE)\.nuget\packages\pdfiumviewer.native.x86_64.v8-xfa\2018.4.8.256\Build\x64\pdfium.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Upvotes: 0
Reputation: 1
So if you are using Winforms, my solution was installing these two packages
And then go to solution explorer, find the x86 where the pdfium.dll is located (bin\debug\x86) and then drag that into the References in the solution explorer in visual studio.
Upvotes: 0
Reputation: 4155
I had installed a Nuget package just before receiving this message. It turned out that the missing Pdfium dll was hidden deep in my project's packages folder, but for some reason it didn't get copied to the project's bin folder. After finding the right version (x64) in the folder tree and copying it into the bin folder, it worked.
Upvotes: 0
Reputation: 11
I had this issue. In my case i was working on a project for a client that would run the application with an IIS identity user.
After installing the packages above (PdfiumViewer,PdfiumViewer.Native.x86.v8-xfa ,PdfiumViewer.Native.x86_64.v8-xfa), it still didn't work.
After all the problem was due to lack of permissons of this user (it needs write, modify permissons). Just to let you know another use case that led to the same problem.
Upvotes: 0
Reputation: 694
In case anyone still needs help with this, I was having the same problem and solved it using @Jack 's comment on @Paddy 's solution:
PdfiumViewer
NuGet packagePdfiumViewer.Native.x86.v8-xfa
NuGet packagePdfiumViewer.Native.x86_64.v8-xfa
NuGet packageAfter installing all 3 packages, I published the application (my application is ClickOnce) and executed it, and it worked just fine!
Upvotes: 31
Reputation: 314
I had tremendous grief with this missing dll, until I found the easiest way I found was to go to Nuget Package Manager and install the PDFium.Windows package.
Upvotes: -1
Reputation: 3619
I assume you're using Winforms?
To get the pdfRenderer control in a WinForm: Add the PdfiumViewer
NuGet package to the project; open the projects packages folder in Windows Explorer and drag the PdfiumViewer.dll
file onto the Toolbox
window; A control called PdfRenderer
will be available to add:
Upvotes: 3