Open fashrista opened 5 years ago
Hi @fashrista have you found a solution to use DinkToPdf in .NET Framework 4.8?
Hi @fashrista have you found a solution to use DinkToPdf in .NET Framework 4.8?
No. As far as I can recall we finally decided to use a different lib sharpPDF to create pdfs. I think it was in a Unity project so probably the migradoc plugin with .net2.0 wasu used. Just remember it was really basic and it was alot of work and hacky solutions to implement. But it got the job done.
Nice! In my case, I decided to use OpenHtmlToPdf. I built all the content in HTML and then passed it to the library to generate the PDF. Cheers!
I have a .Net Framework 4.8 app and in it I need to convert some html/css into pdf.
I have sampled a demo project of DinkToPdf. This worked in .NET core app and in Xamarin Forms app (where I ocasionally get Memory accsess violation Exception), but cannot get it to function in a .Net Framewrk app.
I have added DinkToPDF v1.0.8 to my project's reference folder via NugetPackageManager. I have looked into package dependencies and made shure that all are up to required versions. There is a native lib that I needed to copy to my projects root becouse the DinkToPdf uses it: libwkhtmltox.dll (I have tryed different versions of this) I have also tryed RndUsr0.DinkToPdf package, which "Upgraded to .NET Standard 2.0, .NET Core 2.1, wkhtmltopdf v0.12.5." but had no beter results.
What happens: When my app calls basicConverter.Converet(HtmlToPdfDocument doc)I get an Exception:"DinkToPdf.WkHtmlToXBindings::wkhtmltopdf_init' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.' "
To conclude: I would expect the DinkToPdf nuget package with libwkhtmltox.dll native lib to function in a .NET Framework app just as well as it functions in a .NET Core app. But it does not.
What have I missed?