减小文件大小
Contents
[
Hide
]
减小文件大小
Aspose.Diagram for Java API 允许开发人员从 diagram 中删除隐藏信息以减小文件大小。 这页对象表示前景页面或背景页面的绘图区域。为了减小文件大小,您可以使用删除隐藏信息项中的属性**移除隐藏信息()**的方法Diagram班级。下面的代码示例显示了如何从 diagram 中删除隐藏信息。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(ReduceFileSize.class); | |
// Load a Visio diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
// Remove hidden information from diagram | |
diagram.removeHiddenInformation((int)(RemoveHiddenInfoItem.SHAPES | RemoveHiddenInfoItem.MASTERS)); |