/// <summary>Sets the value of the collection item.</summary>
        /// <param name="key"/>
        /// <param name="value"/>
        public virtual iText.Kernel.Pdf.Collection.PdfCollectionItem AddItem(String key, String value)
        {
            PdfCollectionField field = schema.GetField(key);

            GetPdfObject().Put(new PdfName(key), field.GetValue(value));
            return(this);
        }
Esempio n. 2
0
        public virtual void FieldAddingTest()
        {
            String        fieldName = "fieldName";
            PdfDictionary pdfObject = new PdfDictionary();

            pdfObject.Put(PdfName.Subtype, PdfName.S);
            PdfCollectionField  field  = new PdfCollectionField(pdfObject);
            PdfCollectionSchema schema = new PdfCollectionSchema();

            schema.AddField(fieldName, field);
            // should be the same instance
            NUnit.Framework.Assert.AreEqual(schema.GetField(fieldName).GetPdfObject(), pdfObject);
        }