You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ See [this document](https://github.com/hardkoded/puppeteer-sharp/blob/master/CON
52
52
## Take screenshots
53
53
54
54
<!-- snippet: ScreenshotAsync -->
55
-
<aid='snippet-screenshotasync'></a>
55
+
<aid='snippet-ScreenshotAsync'></a>
56
56
```cs
57
57
usingvarbrowserFetcher=newBrowserFetcher();
58
58
awaitbrowserFetcher.DownloadAsync();
@@ -62,28 +62,28 @@ await using var page = await browser.NewPageAsync();
62
62
awaitpage.GoToAsync("http://www.google.com");
63
63
awaitpage.ScreenshotAsync(outputFile);
64
64
```
65
-
<sup><ahref='/lib/PuppeteerSharp.Tests/ScreenshotTests/PageScreenshotTests.cs#L63-L71'title='Snippet source file'>snippet source</a> | <ahref='#snippet-screenshotasync'title='Start of snippet'>anchor</a></sup>
65
+
<sup><ahref='/lib/PuppeteerSharp.Tests/ScreenshotTests/PageScreenshotTests.cs#L63-L71'title='Snippet source file'>snippet source</a> | <ahref='#snippet-ScreenshotAsync'title='Start of snippet'>anchor</a></sup>
66
66
<!-- endSnippet -->
67
67
68
68
You can also change the view port before generating the screenshot
69
69
70
70
<!-- snippet: SetViewportAsync -->
71
-
<aid='snippet-setviewportasync'></a>
71
+
<aid='snippet-SetViewportAsync'></a>
72
72
```cs
73
73
awaitPage.SetViewportAsync(newViewPortOptions
74
74
{
75
75
Width=500,
76
76
Height=500
77
77
});
78
78
```
79
-
<sup><ahref='/lib/PuppeteerSharp.Tests/ScreenshotTests/ElementHandleScreenshotTests.cs#L21-L27'title='Snippet source file'>snippet source</a> | <ahref='#snippet-setviewportasync'title='Start of snippet'>anchor</a></sup>
79
+
<sup><ahref='/lib/PuppeteerSharp.Tests/ScreenshotTests/ElementHandleScreenshotTests.cs#L21-L27'title='Snippet source file'>snippet source</a> | <ahref='#snippet-SetViewportAsync'title='Start of snippet'>anchor</a></sup>
80
80
<!-- endSnippet -->
81
81
82
82
83
83
## Generate PDF files
84
84
85
85
<!-- snippet: PdfAsync -->
86
-
<aid='snippet-pdfasync'></a>
86
+
<aid='snippet-PdfAsync'></a>
87
87
```cs
88
88
usingvarbrowserFetcher=newBrowserFetcher();
89
89
awaitbrowserFetcher.DownloadAsync();
@@ -93,32 +93,32 @@ await page.GoToAsync("http://www.google.com"); // In case of fonts being loaded
93
93
awaitpage.EvaluateExpressionHandleAsync("document.fonts.ready"); // Wait for fonts to be loaded. Omitting this might result in no text rendered in pdf.
94
94
awaitpage.PdfAsync(outputFile);
95
95
```
96
-
<sup><ahref='/lib/PuppeteerSharp.Tests/PageTests/PdfTests.cs#L29-L39'title='Snippet source file'>snippet source</a> | <ahref='#snippet-pdfasync'title='Start of snippet'>anchor</a></sup>
96
+
<sup><ahref='/lib/PuppeteerSharp.Tests/PageTests/PdfTests.cs#L29-L39'title='Snippet source file'>snippet source</a> | <ahref='#snippet-PdfAsync'title='Start of snippet'>anchor</a></sup>
0 commit comments