Setting ScaleCrop and LinksUpToDate properties of Built-In Document Properties

Possible Usage Scenarios

ScaleCrop and LinksUpToDate are two extended built-in document properties defined inside the OpenXml format. The purpose of these properties are following

1) ScaleCrop

This element indicates the display mode of the document thumbnail. Set this element to TRUE to enable scaling of the document thumbnail to the display. Set this element to FALSE to enable cropping of the document thumbnail to show only sections that fit the display.

The possible values for this element are defined by the W3C XML Schema boolean datatype.

2) LinksUpToDate

This element indicates whether hyperlinks in a document are up-to-date. Set this element to TRUE to indicate that hyperlinks are updated. Set this element to FALSE to indicate that hyperlinks are outdated.

The possible values for this element are defined by the W3C XML Schema boolean datatype.

Screenshot showing these properties inside the app.xml file

todo:image_alt_text

Setting ScaleCrop and LinksUpToDate properties of Built-In Document Properties

The following sample code sets the ScaleCrop and LinksUpToDate extended built-in document properties of the workbook. Please check the output excel file generated with this code, change its extension to .zip and extract its contents and view the app.xml as shown in the screenshot above.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Create directory if it is not already present.
bool IsExists = System.IO.Directory.Exists(dataDir);
if (!IsExists)
System.IO.Directory.CreateDirectory(dataDir);
// Instantiating a Workbook object.
Workbook workbook = new Workbook();
// Setting ScaleCrop and LinksUpToDate BuiltIn Document Properties.
workbook.BuiltInDocumentProperties.ScaleCrop = true;
workbook.BuiltInDocumentProperties.LinksUpToDate = true;
// Saving the Excel file.
workbook.Save(dataDir + "output.xls", SaveFormat.Auto);