Coder Social home page Coder Social logo

Comments (6)

HakanL avatar HakanL commented on June 20, 2024 1

Ah, perfect, thanks for the quick feedback @andbjer ! Please use the new repo , version 1.2 which includes this fix.

from wkhtmltopdf-dotnet.

HakanL avatar HakanL commented on June 20, 2024

Please see if the fix I just pushed solved the issue.

from wkhtmltopdf-dotnet.

andbjer avatar andbjer commented on June 20, 2024

What's the easiest way for me to test this?

I've pulled down the code from the repository and added the project to my solution. I added every runtime manually in the same folder structure as it is listed in DinkToPdf.csproj:

    <None Include="runtimes\linux-x64\native\libwkhtmltox.so" Pack="true" PackagePath="runtimes\linux-x64\native" />
    <None Include="runtimes\linux-x86\native\libwkhtmltox.so" Pack="true" PackagePath="runtimes\linux-x86\native" />
    <None Include="runtimes\osx-x64\native\libwkhtmltox.dylib" Pack="true" PackagePath="runtimes\osx-x64\native" />
    <None Include="runtimes\win-x64\native\wkhtmltox.dll" Pack="true" PackagePath="runtimes\win-x64\native" />
    <None Include="runtimes\win-x86\native\wkhtmltox.dll" Pack="true" PackagePath="runtimes\win-x86\native" />

Now I am getting this error when i try to generate a PDF:

System.DllNotFoundException: Unable to load shared library 'wkhtmltox' or one of its dependencies

from wkhtmltopdf-dotnet.

adamhathcock avatar adamhathcock commented on June 20, 2024

You probably shouldn't even be loading this in EFCore migration.

Change your DI definition to be lazy:

services.AddSingleton<IConverter>(x => new SynchronizedConverter(new PdfTools()))

from wkhtmltopdf-dotnet.

HakanL avatar HakanL commented on June 20, 2024

I uploaded a pre-release to NuGet, try that. https://www.nuget.org/packages/Haukcode.DinkToPdf/1.1.3-test-dispose-fix

from wkhtmltopdf-dotnet.

andbjer avatar andbjer commented on June 20, 2024

Tested the pre-release and migrations is working again. Thank you!

I also tested the suggestion by @adamhathcock before upgrading to the pre-release. This also solved my problem.

Thank you both!

from wkhtmltopdf-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.