예제 #1
0
        private void TestImage(string testFilePath)
        {
            byte[]       testFile  = File.ReadAllBytes(testFilePath);
            PdfConverter converter = new PdfConverter();

            byte[] pdf = converter.ConvertImage(testFile, Path.GetFileName(testFilePath), new ImageConversionOptions());
            Assert.IsNotNull(pdf);
            Assert.IsTrue(pdf.Length > 0);
        }
예제 #2
0
        public void TestSilentFailNoPageOnUnsupportedImage()
        {
            string testFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "test_files\\unsupported\\image.tga");

            byte[]       testFile  = File.ReadAllBytes(testFilePath);
            PdfConverter converter = new PdfConverter();

            byte[] pdf = converter.ConvertImage(testFile, Path.GetFileName(testFilePath), new ImageConversionOptions()
            {
                SilentFailOnUnsupportedType = true, UsePlaceholderPageOnUnsupportedType = false
            });
            Assert.IsNull(pdf);
        }