Пример #1
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);
        }
        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);
        }
Пример #3
0
 public virtual void CustomVersionIncorrectPatchTest()
 {
     iText.Kernel.Version customVersion = new iText.Kernel.Version(new VersionInfo("iText®", "7.50.a-SNAPSHOT",
                                                                                   "iText® 7.50.a-SNAPSHOT ©2000-2090 iText Group NV", null), false);
     NUnit.Framework.Assert.IsFalse(CheckVersion(customVersion.GetVersion()));
 }