public async Task Should_Create_Pdf_From_Input_Text_Async() { var trace = new DebugTraceWriter(); using (WeasyPrintClient client = new WeasyPrintClient(trace)) { var data = await client.GeneratePdfAsync("<h1>Hello World </h1>"); Assert.NotNull(data); } }
public async Task Should_Create_Pdf_From_Input_File_Async() { var trace = new DebugTraceWriter(); var input = $"{_inputFolder}\\complex.html"; var output = $"{_outputFolder}\\output.pdf"; using (WeasyPrintClient client = new WeasyPrintClient(trace)) { await client.GeneratePdfAsync(input, output); } }
static async Task Main(string[] args) { var trace = new ConsoleTraceWriter(); using (WeasyPrintClient client = new WeasyPrintClient(trace)) { var html = "<!DOCTYPE html><html><body><h1>Hello World</h1></body></html>"; var data = await client.GeneratePdfAsync(html); //File.WriteAllBytes("test.pdf", data); } Console.ReadLine(); }