public virtual void MultiSelectByValueTest()
        {
            String      outPdf   = destinationFolder + "multiSelectByValueTest.pdf";
            String      cmpPdf   = sourceFolder + "cmp_multiSelectByValueTest.pdf";
            PdfDocument document = new PdfDocument(new PdfWriter(outPdf));

            document.AddNewPage();
            PdfAcroForm        form   = PdfAcroForm.GetAcroForm(document, true);
            PdfChoiceFormField choice = (PdfChoiceFormField)PdfFormField.CreateList(document, new Rectangle(336, 666,
                                                                                                            50, 80), "choice", "two", new String[] { "one", "two", "three", "four" }, null, null).SetBorderColor(ColorConstants
                                                                                                                                                                                                                 .BLACK);

            choice.SetMultiSelect(true);
            choice.SetListSelected(new String[] { "one", "three", "eins", "drei" });
            NUnit.Framework.Assert.AreEqual(new int[] { 0, 2 }, choice.GetIndices().ToIntArray());
            PdfArray values = (PdfArray)choice.GetValue();

            String[] valuesAsStrings = new String[values.Size()];
            for (int i = 0; i < values.Size(); i++)
            {
                valuesAsStrings[i] = values.GetAsString(i).ToUnicodeString();
            }
            NUnit.Framework.Assert.AreEqual(new String[] { "one", "three", "eins", "drei" }, valuesAsStrings);
            form.AddField(choice);
            document.Close();
            NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdf, cmpPdf, destinationFolder));
        }
        public virtual void TopIndexTest()
        {
            String             srcPdf   = sourceFolder + "choiceFieldNotFittingTest.pdf";
            String             outPdf   = destinationFolder + "topIndexTest.pdf";
            String             cmpPdf   = sourceFolder + "cmp_topIndexTest.pdf";
            PdfDocument        document = new PdfDocument(new PdfReader(srcPdf), new PdfWriter(outPdf));
            PdfAcroForm        form     = PdfAcroForm.GetAcroForm(document, false);
            PdfChoiceFormField field    = (PdfChoiceFormField)form.GetField("choice");

            field.SetListSelected(new String[] { "seven" });
            int topIndex = field.GetIndices().GetAsNumber(0).IntValue();

            field.SetTopIndex(topIndex);
            document.Close();
            NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdf, cmpPdf, destinationFolder));
        }