Let’s check out:
They might overlap, but there is no best solution. Each depends on your use case and requirements.
Puppeteer Sharp client for C# (.NET)
To take screenshots of any URL in the modern version of C#, you can use a headless browser library like PuppeteerSharp. Puppeteer Sharp is a .NET port of the popular JavaScript library Puppeteer, which controls headless Chromium or Chrome browsers.
In your .NET project, add the Puppeteer Sharp package using the NuGet Package Manager, or run the following command in the Package Manager Console:
Create a new C# file and add the following code, replacing https://example.com
with the URL you want to take a screenshot of, and “screenshot.png” with the desired output file name.
Execute the program, and it will take a screenshot of the specified URL and save it as an image file in the project’s output directory. Remember to replace the URL and output file name with the desired values.
If you just want to take one or two screenshots locally, the PuppeteerSharp client is not the best fit. But if you plan to take millions of screenshots and manage browser instances, you can do it yourself, but it is better to outsource to well-established services.
Screenshot API as a service
ScreenshotOne specializes in taking screenshots and managing browser instances at scale. The service provides a high-quality C# (.NET) client to take screenshots and cover a variety of use cases.
Massive thanks and rays of goodness to Andy Robinson (Indie Hackers, GitHub) for providing the fully-featured high-quality C# (.NET) SDK.
It is easy to install. You can add the library via nuget using the package manager console:
Or from the .NET CLI as:
Don’t forget to sign up to get access and secret keys.
Generate a screenshot URL without executing request:
Take a screenshot and save the image in the file:
If you feel that it is the best fit for you, feel free to sign up for our screenshot API and get the access key.
Summary
Pick the solution which suits your needs best. If you decide to go with our API, please ask any questions and mail us at support@screenshotone.com. And have a nice day 👋
By the way, you might also find interesting how to: