UseSdtTagAsFormFieldName

PdfSaveOptions.UseSdtTagAsFormFieldName property

Specifies whether to use SDT control Tag or Id property as a name of form field in PDF.

public bool UseSdtTagAsFormFieldName { get; set; }

Remarks

The default value is false.

When set to false, SDT control Id property is used as a name of form field in PDF.

When set to true, SDT control Tag property is used as a name of form field in PDF.

If set to true and Tag is empty, Id property will be used as a form field name.

If set to true and Tag values are not unique, duplicate Tag values will be altered to build unique PDF form field names.

Examples

Shows how to use SDT control Tag or Id property as a name of form field in PDF.

Document doc = new Document(MyDir + "Form fields.docx");

PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.PreserveFormFields = true;
// When set to 'false', SDT control Id property is used as a name of form field in PDF.
// When set to 'true', SDT control Tag property is used as a name of form field in PDF.
saveOptions.UseSdtTagAsFormFieldName = true;

doc.Save(ArtifactsDir + "PdfSaveOptions.SdtTagAsFormFieldName.pdf", saveOptions);

See Also