Aspose.Pdf.Examples.CSharp.AsposePdfGenerator.UtilityFeatures.ManipulatingFormFields.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:ManipulatingFormFields
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_UtilityFeatures();

            // Instantiate a Pdf instance
            Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();

            // Add a section in the Pdf document
            Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();

            // Create a form field
            Aspose.Pdf.Generator.FormField combo = new Aspose.Pdf.Generator.FormField();

            // Set the type of form field to Combo
            combo.FormFieldType = Aspose.Pdf.Generator.FormFieldType.Combo;

            // Set the field name
            combo.FieldName = "ACombo";

            // Add few options to the combo
            combo.ChoiceOptions = new string[] { "Red", "Green", "Blue" };

            // Set the default selected value of the combo field
            combo.FieldValue = "Red";

            // Set the width of the field
            combo.FormWidth = 80;

            // Set the height of the field
            combo.FormHeight = 20;

            // Add the combo form field to the paragraphs collection of the section
            sec1.Paragraphs.Add(combo); 

            dataDir = dataDir + "ManipulatingFormFields_out.pdf";
            // Save the Pdf
            pdf1.Save(dataDir);
            // ExEnd:ManipulatingFormFields           
        }
        public static void RadioButtonWithCustomPosition()