arklumpus / MuPDFCore

Multiplatform .NET bindings for MuPDF
GNU Affero General Public License v3.0
115 stars 20 forks source link

Method not found: 'Void MuPDFCore.MuPDFContext..ctor(Int64)'. #13

Closed tomasr78 closed 2 years ago

tomasr78 commented 2 years ago

I get exceptions when trying to run the code

        //Save the full page as a PNG image.
        renderedPage.SaveAsPNG("page" + i.ToString() + ".png");

The code is taken from your readme, where you show how to convert PDF to png.

Actual exception

System.MissingMethodException: Method not found: 'Void MuPDFCore.MuPDFContext..ctor(Int64)'.
   at VectSharp.Raster.Raster.SaveAsPNG(Page page, String fileName, Double scale)
   at MuPDFWrapperCore.Program.Main(String[] args) in

Project .NET6 64bit.

arklumpus commented 2 years ago

I think that's because I need to recompile VectSharp to use the latest version of MuPDFCore (I had to change the signature for the MuPDFContext constructor).

I will do it shortly, in the mean time it should work if you downgrade MuPDFCore to 1.3.1 (but it shouldn't take me more than a couple of hours).

arklumpus commented 2 years ago

Ok, I have updated VectSharp - just make sure you are using VectSharp.Raster v2.0.7 and it should work.