Example #1
0
        public void Render(string filename, int pagenum, double ratio, int width, int height)
        {
            var src  = GetSource(filename);
            var dest = Get($"{IO.Get(src).BaseName}-{pagenum}.png");

            using (var reader = new DocumentReader(GetSource(filename)))
            {
                var page = reader.GetPage(pagenum);
                using (var image = reader.Render(page, ratio))
                {
                    Assert.That(image.Width, Is.EqualTo(width));
                    Assert.That(image.Height, Is.EqualTo(height));
                    image.Save(dest, ImageFormat.Png);
                }
            }

            Assert.That(IO.Exists(dest), Is.True);
        }