SaveOptionsUpdateFields Property

Gets or sets a value determining if fields of certain types should be updated before saving the document to a fixed page format. Default value for this property is true.

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

ExpandedSyntax

public bool UpdateFields { get; set; }

Property Value

Type: Boolean

ExpandedRemarks

Allows to specify whether to mimic or not MS Word behavior.

ExpandedExamples

Shows how to update fields before saving into a PDF document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert two pages of text, including two fields that will need to be updated to display an accurate value
builder.Write("Page ");
builder.InsertField("PAGE", "");
builder.Write(" of ");
builder.InsertField("NUMPAGES", "");
builder.InsertBreak(BreakType.PageBreak);
builder.Writeln("Hello World!");

PdfSaveOptions options = new PdfSaveOptions();
options.UpdateFields = doUpdateFields;

// PdfSaveOptions objects can be cloned
Assert.AreNotSame(options, options.Clone());

doc.Save(ArtifactsDir + "PdfSaveOptions.UpdateFields.pdf", options);

ExpandedSee Also