public virtual void FieldCreationWithNameAndSubTypeTest() { String fieldName = "fieldName"; for (int i = 0; i < ALLOWED_PDF_NAMES.Length; i++) { PdfCollectionField field = new PdfCollectionField(fieldName, EXPECTED_SUB_TYPES[i]); NUnit.Framework.Assert.AreEqual(new PdfString(fieldName), field.GetPdfObject().Get(PdfName.N)); NUnit.Framework.Assert.AreEqual(ALLOWED_PDF_NAMES[i], field.GetPdfObject().Get(PdfName.Subtype)); } }
public virtual void FieldCreationWithDefaultSubTypeTest() { String fieldName = "fieldName"; int unexpectedSubType = -1; PdfName defaultSubType = PdfName.S; PdfCollectionField field = new PdfCollectionField(fieldName, unexpectedSubType); NUnit.Framework.Assert.AreEqual(defaultSubType, field.GetPdfObject().Get(PdfName.Subtype)); }
/// <summary>Adds a Collection field to the Schema.</summary> /// <param name="name">the name of the collection field</param> /// <param name="field">a Collection Field</param> /// <returns/> public virtual iText.Kernel.Pdf.Collection.PdfCollectionSchema AddField(String name, PdfCollectionField field ) { GetPdfObject().Put(new PdfName(name), field.GetPdfObject()); return(this); }