forked from mstancombe/HTML-Renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (26 loc) · 1.12 KB
/
Program.cs
File metadata and controls
35 lines (26 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using HtmlRenderer.Demo.Console;
using System.Diagnostics;
using TheArtOfDev.HtmlRenderer.Demo.Common;
//By default, write to a sub folder 'output'
string basePath= @".\Ouput";
if (args.Length > 0)
{
//And if there's an output path given, use that.
basePath = args[0];
}
//Probably won't be running a suite of tests more than once a second, so this will do.
var runIdentifier = DateTime.Now.ToString("yyyyMMdd-hhmmss");
var skia = new SkiaPdfConverter(runIdentifier, basePath);
var svgSkia = new SkiaSvgConverter(runIdentifier, basePath);
var pdfSharp = new PdfSharpCoreConverter(runIdentifier, basePath);
SamplesLoader.Init("Console", typeof(Program).Assembly.GetName().Version.ToString());
var samples = SamplesLoader.TestSamples;
foreach (var htmlSample in samples)
{
////Just doing one test here. Comment this for all of them.
if (!htmlSample.FullName.Contains("16", StringComparison.OrdinalIgnoreCase)) continue;
await skia.GenerateSampleAsync(htmlSample);
await svgSkia.GenerateSampleAsync(htmlSample);
//await pdfSharp.GenerateSampleAsync(htmlSample);
}
//At this point.. there should be something!!