SaveOptionsUpdateSdtContent Property

Gets or sets value determining whether content of StructuredDocumentTag is updated before saving.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.10.0


public bool UpdateSdtContent { get; set; }

Property Value

Type: Boolean


The default value is true.


Shows how structured document tags can be updated while saving to .pdf.
Document doc = new Document();

// Insert two StructuredDocumentTags; a date and a drop-down list 
StructuredDocumentTag tag = new StructuredDocumentTag(doc, SdtType.Date, MarkupLevel.Block);
tag.FullDate = DateTime.Now;


tag = new StructuredDocumentTag(doc, SdtType.DropDownList, MarkupLevel.Block);
tag.ListItems.Add(new SdtListItem("Value 1"));
tag.ListItems.Add(new SdtListItem("Value 2"));
tag.ListItems.Add(new SdtListItem("Value 3"));
tag.ListItems.SelectedValue = tag.ListItems[1];


// We've selected default values for both tags
// We can save those values in the document without immediately updating the tags, leaving them in their default state
// by using a SaveOptions object with this flag set
PdfSaveOptions options = new PdfSaveOptions();
options.UpdateSdtContent = updateSdtContent;

doc.Save(ArtifactsDir + "StructuredDocumentTag.UpdateSdtContent.pdf", options);

ExpandedSee Also