.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfGraphicsAcroFormComboBoxField Class

Represents a combo box field.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v20.2.Drawing.dll


public class PdfGraphicsAcroFormComboBoxField :


To create a combo box field, call the PdfGraphicsAcroFormField.CreateComboBox method with specified the field name and field rectangle.

To add values to a combo box, call one of the PdfGraphicsAcroFormChoiceField.AddValue overloaded methods.

You can specify the combo box name, tooltip and appearance using PdfGraphicsAcroFormField.Name, PdfGraphicsAcroFormField.ToolTip, PdfGraphicsAcroFormField.Appearance properties.

To select an item of a combo box by an export value, call the PdfAcroFormChoiceField.SelectValue method using this value.

To add a combo box field to PDF graphics, pass a PdfGraphicsAcroFormComboBoxField object representing the combo box field as a parameter to the PdfGraphics.AddFormField method. To access PdfGraphics, you need to reference the DevExpress.Pdf.Drawing assembly.

To render a page with the PDF graphics, call one of PdfDocumentProcessor.RenderNewPage overloaded methods.


This example shows how to create a combo box field and add it to a PDF document using the Document Creation API.

using DevExpress.Pdf;
using System.Drawing;

namespace AddComboBoxField {
    class Program {
        static void Main(string[] args) {
            using (PdfDocumentProcessor processor = new PdfDocumentProcessor()) {

                // Create an empty document. 

                // Create graphics and draw a combo box field.
                using (PdfGraphics graphics = processor.CreateGraphics()) {

                    // Render a page with graphics.
                    processor.RenderNewPage(PdfPaperSize.Letter, graphics);

        static void DrawComboBoxField(PdfGraphics graphics) {

            // Create a combo box field specifying its name and location.
            PdfGraphicsAcroFormComboBoxField comboBox = new PdfGraphicsAcroFormComboBoxField("combo Box", new RectangleF(20, 20, 100, 20));

            // Add values to the combo box.  

            // Specify combo box selected value, text allignment, and appearance.
            comboBox.TextAlignment = PdfAcroFormStringAlignment.Far;
            comboBox.Appearance.BackgroundColor = Color.Beige;
            comboBox.Appearance.FontSize = 14;

            // Add the field to the document.
See Also