pruiz / WkHtmlToXSharp

C# wrapper wrapper (using P/Invoke) for the excelent Html to PDF conversion library wkhtmltopdf library.
239 stars 84 forks source link

Could not load file or assembly `System.Configuration.ConfigurationManager` #59

Open amura11 opened 2 years ago

amura11 commented 2 years ago

Steps to Reproduce

  1. Install the WkHtmlToXSharp.Bundle Nuget package
  2. 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.