Exemplo n.º 1
0
 public void Setup()
 {
     document = new Document();
     // Workaround for a quirk in the migradoc API.
     _          = document.AddSection().Elements;
     pdfBuilder = new PdfBuilder(document, PdfOptions.Default);
     renderer   = new LinkInlineRenderer(null);
     inline     = new LinkInline();
     inline.Url = "sample link";
 }
Exemplo n.º 2
0
        public void TestImageFromLocalFile()
        {
            string fileName = Path.GetTempFileName();
            Image  image    = new Bitmap(4, 4);

            image.Save(fileName);
            try
            {
                string imageName = Path.GetFileName(fileName);
                string filePath  = Path.GetDirectoryName(fileName);
                renderer       = new LinkInlineRenderer(filePath);
                inline.IsImage = true;

                Assert.DoesNotThrow(() => renderer.GetImage(imageName).Dispose());
            }
            finally
            {
                File.Delete(fileName);
            }
        }