Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfAcroFormVisualField.ReadOnly Property

Gets or sets whether the interactive form field allows edit operations.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v24.2.Core.dll

NuGet Package: DevExpress.Pdf.Core

#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