WkHtmlToXSharp
WkHtmlToXSharp copied to clipboard
Could not load file or assembly `System.Configuration.ConfigurationManager`
Steps to Reproduce
- Install the
WkHtmlToXSharp.Bundle
Nuget package - Try to run the following code:
WkHtmlToXLibrariesManager.Register(new Linux32NativeBundle());
WkHtmlToXLibrariesManager.Register(new Linux64NativeBundle());
WkHtmlToXLibrariesManager.Register(new Win32NativeBundle());
WkHtmlToXLibrariesManager.Register(new Win64NativeBundle());
using (MultiplexingConverter converter = new MultiplexingConverter())
{
//WkHtmlToPdfConverter converter = new WkHtmlToPdfConverter();
converter.GlobalSettings.Size.PageSize = PdfPageSize.Letter;
byte[] data = converter.Convert(@"
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
");
File.WriteAllBytes("test.pdf", data);
}
Obviously the fix is to install System.Configuration.ConfigurationManager
but the dependencies of WkHtmlToXSharp
should probably include this so it gets installed automatically.