示例#1
0
        public void PrintGoogle()
        {
            var pdf   = new GeckoPdf(new GeckoPdfConfig());
            var bytes = pdf.Convert("https://google.com");

            Assert.IsTrue(bytes.Length > EmptyDocLength);

            GeckoPdf.UnloadGecko();
        }
示例#2
0
        public void PrintW3Html()
        {
            using (var client = new HttpClient())
            {
                var url = "https://www.w3.org";
                var r   = client.GetStringAsync(url);

                r.Wait();

                var pdf   = new GeckoPdf(new GeckoPdfConfig());
                var bytes = pdf.ConvertHtml(url, r.Result, null, null);
                Assert.IsTrue(bytes.Length > EmptyDocLength);

                GeckoPdf.UnloadGecko();
            }
        }