示例#1
0
        public virtual void DuplicateTest()
        {
            FingerPrint fingerPrint = new FingerPrint();

            fingerPrint.RegisterProduct(productInfo);
            NUnit.Framework.Assert.IsFalse(fingerPrint.RegisterProduct(productInfo));
        }
示例#2
0
        public virtual void NormalAddTest()
        {
            FingerPrint fingerPrint = new FingerPrint();

            NUnit.Framework.Assert.IsTrue(fingerPrint.RegisterProduct(productInfo));
            NUnit.Framework.Assert.IsTrue(fingerPrint.RegisterProduct(productInfo2));
            NUnit.Framework.Assert.AreEqual(2, fingerPrint.GetProducts().Count);
        }
示例#3
0
        /// <summary>Convenience method to write the fingerprint preceding the trailer.</summary>
        /// <remarks>
        /// Convenience method to write the fingerprint preceding the trailer.
        /// The fingerprint contains information on iText products used in the generation or manipulation
        /// of an outputted PDF file.
        /// </remarks>
        /// <param name="document">pdfDocument to write the fingerprint to</param>
        protected internal static void WriteKeyInfo(PdfDocument document)
        {
            PdfWriter   writer      = document.GetWriter();
            FingerPrint fingerPrint = document.GetFingerPrint();
            String      platform    = " for .NET";
            VersionInfo versionInfo = document.GetVersionInfo();
            String      k           = versionInfo.GetKey();

            if (k == null)
            {
                k = "iText";
            }
            writer.WriteString(MessageFormatUtil.Format("%{0}-{1}{2}\n", k, versionInfo.GetRelease(), platform));
            foreach (ProductInfo productInfo in fingerPrint.GetProducts())
            {
                writer.WriteString(MessageFormatUtil.Format("%{0}\n", productInfo));
            }
        }