Esempio n. 1
0
        public void Should_Create_Pdf_From_Input_Text()
        {
            var trace = new DebugTraceWriter();

            using (WeasyPrintClient client = new WeasyPrintClient(trace))
            {
                var data = client.GeneratePdf("<h1>Hello World </h1>");

                Assert.NotNull(data);
            }
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        public async Task Should_Create_Pdf_From_Url_Async()
        {
            var trace = new DebugTraceWriter();

            var url = "https://www.google.com";

            using (WeasyPrintClient client = new WeasyPrintClient(trace))
            {
                var result = await client.GeneratePdfFromUrlAsync(url);

                File.WriteAllBytes($"{_outputFolder}\\url.pdf", result);
            }
        }