HakanL / WkHtmlToPdf-DotNet

C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
GNU Lesser General Public License v3.0
372 stars 67 forks source link

If I run my project out of Visual Studio 2019... #67

Closed hauffautomation closed 2 years ago

hauffautomation commented 2 years ago

When I start my project from Visual Studio, converting HTML to PDF works. As soon as I publish it and install the setup the conversion does not work anymore - unfortunately without any error message. At which point do the runtimes WkHtmlToPdf have to be located?

HakanL commented 2 years ago

What .NET framework are you publishing for? See if you publish/run it in debug to see if there are any errors that can guide you to figure out what the issue is. Basically you should have the native binaries as part of the published folder.

hauffautomation commented 2 years ago

I use .NET 4.7.2 In my published folder I see only WkHtmlToPdfDotNet.dll.deploy.

hauffautomation commented 2 years ago

Is there a way to display the path to the runtimes during runtime

hauffautomation commented 2 years ago

The solution for me was to add the following to the .csproj or .vbproj file:
`

Always.

`

First, I copied the "runtimes" folder into the project directory.

HakanL commented 2 years ago

Yeah this is a duplicate of #39, we don't have a good solution to support publish in the old .NET Framework at the moment.