Skip to content

Commit 0c94155

Browse files
committed
html to image docs and examples
1 parent 6db6e71 commit 0c94155

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

Api2Pdf.Examples/Program.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,22 @@ static void Main(string[] args)
6262

6363
Console.WriteLine($"Chrome URL to PDF: {result.FileUrl}");
6464

65+
//Chrome - HTML to Image
66+
result = a2pClient.Chrome.HtmlToImage(new ChromeHtmlToImageRequest
67+
{
68+
Html = sampleHtml
69+
});
70+
71+
Console.WriteLine($"Chrome HTML to Image: {result.FileUrl}");
72+
73+
//Chrome - URL to Image
74+
result = a2pClient.Chrome.UrlToImage(new ChromeUrlToImageRequest
75+
{
76+
Url = "https://www.api2pdf.com"
77+
});
78+
79+
Console.WriteLine($"Chrome Url to Image: {result.FileUrl}");
80+
6581
//Wkhtml
6682

6783
//Wkhtml - HTML to PDF

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,23 @@ An `Api2PdfResult` object is returned from every API call. If a call is unsucces
179179
Options = options
180180
};
181181
var apiResponse = a2pClient.Chrome.UrlToPdf(request);
182+
183+
184+
**Convert HTML to Image or HTML to PNG**
185+
186+
var request = new ChromeHtmlToImageRequest
187+
{
188+
Html = "<p>Hello World</p>"
189+
};
190+
var apiResponse = a2pClient.Chrome.HtmlToImage(request);
191+
192+
**Convert URL to Image or URL to PNG**
193+
194+
var request = new ChromeUrlToImageRequest
195+
{
196+
Url = "https://www.api2pdf.com"
197+
};
198+
var apiResponse = a2pClient.Chrome.UrlToImage(request);
182199

183200
---
184201

0 commit comments

Comments
 (0)