ConvertImage() public method

public ConvertImage ( byte image, string fileName, ImageConversionOptions options ) : byte[]
image byte
fileName string
options ImageConversionOptions
return byte[]
 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);
 }
Exemplo n.º 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);
 }