PDFiumSharp icon indicating copy to clipboard operation
PDFiumSharp copied to clipboard

BadImageFormatException

Open ghost1face opened this issue 7 years ago • 2 comments

I'm running on x64 and have pulled down the source, everything compiles successfully but at runtime running the Test.Console project I get the exception.

It looks like its trying to load the pdfium_x86.dll. Have you run into this?

if (RuntimeInformation.ProcessArchitecture == Architecture.X64)
    lock(_lock) { return PlatformInvoke.FPDF_LoadDocument_x64(file_path, password); }
else if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
    lock(_lock) { return PlatformInvoke.FPDF_LoadDocument_x86(file_path, password); }
else
    throw new PlatformNotSupportedException();

ghost1face avatar Feb 14 '18 06:02 ghost1face

Based on my testing last night, it seems like the problem is associated to .NETStandard 1.4. I updated the library to target .NETStandard2.0 and it works just fine.

ghost1face avatar Feb 15 '18 03:02 ghost1face

Thanks for your efforts, Ill update to 2.0 soon

ArgusMagnus avatar Feb 17 '18 10:02 ArgusMagnus