public string Get()
        {
            var    ms       = new MemoryStream();
            var    writer   = new PdfWriter(ms);
            var    pdf      = new PdfDocument(writer);
            var    document = new Document(pdf);
            var    info     = new iText.Kernel.Version();
            string result   = "ab-itext-dotnetcore-poc: " + info.GetProduct() + "," + info.GetRelease() + "," + info.GetVersion();

            // result.Content = new StreamContent(ms);
            // result.Content.Headers.ContentType =
            //     new MediaTypeHeaderValue("application/octet-stream");
            return(result);
        }
Esempio n. 2
0
        private static void CheckVersionInstance(iText.Kernel.Version instance)
        {
            String      product = instance.GetProduct();
            String      release = instance.GetRelease();
            String      version = instance.GetVersion();
            String      key     = instance.GetKey();
            VersionInfo info    = instance.GetInfo();

            NUnit.Framework.Assert.AreEqual(product, info.GetProduct());
            NUnit.Framework.Assert.AreEqual("iText®", product);
            NUnit.Framework.Assert.AreEqual(release, info.GetRelease());
            NUnit.Framework.Assert.IsTrue(release.Matches("[7]\\.[0-9]+\\.[0-9]+(-SNAPSHOT)?$"));
            NUnit.Framework.Assert.AreEqual(version, info.GetVersion());
            NUnit.Framework.Assert.IsTrue(CheckVersion(version));
            NUnit.Framework.Assert.IsNull(key);
        }