VS2017 ver 15.9.3
NuGet Packages PdfiumViewer version="2.13.0.0"
PdfiumViewer.Native.x86_64.v8-xfa version="2018.4.8.256"
3. Create Project2: Target Framework = .Net Framework 4.7.2 or any other FW 4.5, 4.5, 4.6 ( ** NOT FW 4 ).
Error Message: $exception {"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"} System.BadImageFormatException
Error Message: $exception {"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"} System.BadImageFormatException
private void button1_Click(object sender, EventArgs e)
{
string pdf = @"D:\PDF\TestFile.pdf";
try
{
var document = PdfiumViewer.PdfDocument.Load(pdf); // *** Exception ***
MessageBox.Show("OK");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
==============
Help is appreciated.
Add both the x86 and x64 folders containing pdfium.dll to the Debug/Release directories, that should be the way. In case you don't know where to find them, run the PdfiumViewer.Demo project from PdfiumViewer Github, you will find them inside the bin folder.
User contributions licensed under CC BY-SA 3.0