设置内置文档属性的ScaleCrop和LinksUpToDate属性

可能的使用场景

scale_croplinks_up_to_date 是OpenXml格式中定义的两个扩展内置文档属性。这些属性的用途如下:

1) ScaleCrop

此元素指示文档缩略图的显示模式。将此元素设置为TRUE以启用文档缩略图的缩放以进行显示。将此元素设置为FALSE以启用文档缩略图的裁剪,以仅显示适合显示器的部分。

此元素的可能值由W3C XML Schema布尔数据类型定义。

2) LinksUpToDate

此元素指示文档中的超链接是否为最新状态。将此元素设置为TRUE表示超链接已更新。将此元素设置为FALSE表示超链接已过时。

此元素的可能值由W3C XML Schema布尔数据类型定义。

截图显示了app.xml文件中的这些属性

todo:image_alt_text

设置内置文档属性的ScaleCrop和LinksUpToDate属性

以下示例代码设置工作簿的 scale_croplinks_up_to_date 扩展内置文档属性。请检查此代码生成的 输出Excel文件,将扩展名改为 .zip,解压后查看 app.xml 如上方截图所示。

from aspose.cells import SaveFormat, Workbook
from os import os, path
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Create directory if it is not already present.
IsExists = path.isdir(dataDir)
if notIsExists:
os.makedirs(dataDir)
# Instantiating a Workbook object.
workbook = Workbook()
# Setting ScaleCrop and LinksUpToDate BuiltIn Document Properties.
workbook.built_in_document_properties.scale_crop = True
workbook.built_in_document_properties.links_up_to_date = True
# Saving the Excel file.
workbook.save(dataDir + "output.xls", SaveFormat.AUTO)