
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
SolidCompany.Wrappers.WkHtmlToImage
Advanced tools
SolidCompany.Wrappers.WkHtmlToImage
is a .NET Core wrapper for a part of an open-source project wkhtmltopdf which is wkhtmltoimage
. It supports converting an HTML to images in a selected format.
You can get SolidCompany.Wrappers.WkHtmlToImage
package by downloading it from NuGet feed.
SolidCompany.Wrappers.WkHtmlToImage
easily integrates with .NET Core Dependency Injection. You need only one line of code to get everything working:
public void ConfigureServices(IServiceCollection services)
{
// ...
services.AddHtmlToImageConversion();
// ...
}
Now you are free to use this powerful tool by injecting IHtmlToImage
into a constructor:
public class SampleService
{
private readonly IHtmlToImage htmlToImage;
public SampleService(IHtmlToImage htmlToImage)
{
this.htmlToImage = htmlToImage;
}
public async Task<Stream> ConvertHtmlToImageAsync(string html, int widthPx)
{
return await htmlToImage.CreateImageAsync(html, widthPx, ImageFormat.Png);
}
}
Image height is automatically scaled to width which preserves a valid ratio.
You can pass a few additional options to configuration:
services.AddHtmlToImageConversion((serviceProvider, options) =>
{
options.DependencyLogger = new ApplicationInsightsDependencyLogger(serviceProvider.GetRequiredService<TelemetryClient>());
options.ExecutionTimeout = TimeSpan.FromMinutes(2);
options.ExectuionDirectory = new CustomDirectory("C:/Temp");
});
DependencyLogger
allows to track every wkhtmltoimage call with Azure Application Insights. To use it you need SolidCompany.Wrappers.Logging.ApplicationInsights
package.
ExecutionTimeout
lets you specify a maximum wkhtmltoimage
execution time. Default is 30 seconds.
ExectuionDirectory
specifies where the exe file is run and where temporary files are created. By default %TEMP%\SolidCompany.Wrappers.WkHtmlToImage
directory is used.
FAQs
.NET Core wrapper for wkhtmltoimage
We found that solidcompany.wrappers.wkhtmltoimage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.