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.
Syntax
public bool UpdateFields { get; set; }
Public Property UpdateFields As Boolean
Get
Set
public:
property bool UpdateFields {
bool get ();
void set (bool value);
}
member UpdateFields : bool with get, set
Property Value
Type:
Boolean
Remarks
Allows to specify whether to mimic or not MS Word behavior.
Examples
Shows how to update all the fields in a document immediately before saving it to PDF.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
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 = updateFields;
Assert.AreNotSame(options, options.Clone());
doc.Save(ArtifactsDir + "PdfSaveOptions.UpdateFields.pdf", options);
See Also