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

PdfAcroFormVisualField.ReadOnly Property

Gets or sets whether the interactive form field allows editing.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v21.1.Core.dll

Declaration

public bool ReadOnly { get; set; }

Property Value

Type Description
Boolean

true, if end-users cannot modify the form field’s value; otherwise, false.

Remarks

The code sample below creates a locked text box field:

using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
    pdfDocumentProcessor.LoadDocument("Documents//Invoice.pdf");

    // Create a text box field:
    PdfAcroFormTextBoxField textBox =
          new PdfAcroFormTextBoxField("text box", 1, new PdfRectangle(230, 690, 280, 710));

    // Specify text box text and appearance:
    textBox.Text = "Text Box";
    textBox.Appearance.BackgroundColor = new PdfRGBColor(0.8, 0.5, 0.3);
    textBox.Appearance.FontSize = 12;

    // Lock the field:
    textBox.ReadOnly = true;

    pdfDocumentProcessor.AddFormFields(textBox);
}
See Also