Skip to content

Commit

Permalink
Update readme for v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kblok authored Mar 1, 2018
1 parent 17574d5 commit e7f4ff4
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,48 @@
# Introduction
# Puppeteer Sharp

This project is a .NET port of the official [Node.JS Puppeteer API](https://github.com/GoogleChrome/puppeteer).
The first goal is to get a functional library with an API as close as the official one.
[![NuGet](https://img.shields.io/nuget/v/PuppeteerSharp.svg?style=flat-square&label=nuget&colorB=green)](https://www.nuget.org/packages/PuppeteerSharp/)

Puppeteer Sharp is a .NET port of the official [Node.JS Puppeteer API](https://github.com/GoogleChrome/puppeteer).

# Usage

## Take screenshots

```
await Downloader.CreateDefault().DownloadRevisionAsync(chromiumRevision);
var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = true
}, chromiumRevision);
var page = await browser.NewPageAsync();
await page.GoToAsync("http://www.google.com");
await page.ScreenshotAsync(outputFile));
```

You can also change the view port before generating the screenshot


```
await page.SetViewport(new ViewPortOptions
{
Width = 500,
Height = 500
});
```


## Generate PDF files

```
await Downloader.CreateDefault().DownloadRevisionAsync(chromiumRevision);
var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = true
}, chromiumRevision);
var page = await browser.NewPageAsync();
await page.GoToAsync("http://www.google.com");
await page.PdfAsync(outputFile));
```

# Monthly reports

Expand Down

0 comments on commit e7f4ff4

Please sign in to comment.