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.
Many thanks in advance! ~Melvin
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!
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With