File Formats

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum PdfFormFieldVisibility

    Show / Hide Table of Contents

    Enum PdfFormFieldVisibility

    Specifies the form field visibility types

    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public enum PdfFormFieldVisibility
    Examples
    //Create a new PDf document
    PdfDocument document = new PdfDocument();           
    //Creates a new page and adds it as the last page of the document
    PdfPage page = document.Pages.Add();
    PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 12f);
    //Create a text box
    PdfTextBoxField firstNameTextBox = new PdfTextBoxField(page, "firstNameTextBox");
    firstNameTextBox.MaxLength = 8;
    firstNameTextBox.Bounds = new RectangleF(100, 20, 200, 20);
    firstNameTextBox.Font = font;
    //Set the visibility.
    firstNameTextBox.Visibility = PdfFormFieldVisibility.Visible;
    page.Graphics.DrawString("First Name", font, PdfBrushes.Black, 10, 55);
    //Add the textbox in document
    document.Form.Fields.Add(firstNameTextBox);                      
    document.Save("Form.pdf");
    document.Close(true);
    'Create a new PDf document
    Dim document As PdfDocument = New PdfDocument()
    'Create a page
    Dim page As PdfPage = document.Pages.Add()
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Courier, 12f)
    'Create a text box
    Dim firstNameTextBox As PdfTextBoxField = New PdfTextBoxField(page, "firstNameTextBox")
    firstNameTextBox.MaxLength = 8
    firstNameTextBox.Bounds = New RectangleF(100, 20, 200, 20)
    firstNameTextBox.Font = font
    'Set the visibility.
    firstNameTextBox.Visibility = PdfFormFieldVisibility.Visible
    page.Graphics.DrawString("First Name", font, PdfBrushes.Black, 10, 55)
    'Add the textbox in document
    document.Form.Fields.Add(firstNameTextBox)
    document.Save("Form.pdf")
    document.Close(True)

    Fields

    Name Description
    Hidden

    Hidden the visibility of the form field.

    HiddenPrintable

    Indicate hidden the visibility of the form field and not printable.

    Visible

    Indicate visibility of the form field.

    VisibleNotPrintable

    Indicate visibility of the form field and not printable.

    See Also
    PdfDocument
    PdfPage
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved