Reduce File Size
Contents
[
Hide
]
Reduce File Size
Aspose.Diagram for Python via Java API allows developers to remove hidden info from a diagram to reduce file size. The Page object represents the drawing area of a foreground page or a background page.In order to reduce file size, you can use RemoveHiddenInfoItem properties in RemoveHiddenInformation() method of Diagram class. The code example below shows how to remove hidden info from diagram.
This file contains hidden or 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
import jpype | |
import asposediagram | |
jpype.startJVM() | |
from asposediagram.api import * | |
lic = License() | |
lic.setLicense("Aspose.Total.Product.Family.lic") | |
# Load a Visio diagram | |
diagram = Diagram("Drawing1.vsdx") | |
# Remove hidden information from diagram | |
diagram.removeHiddenInformation(RemoveHiddenInfoItem.SHAPES | RemoveHiddenInfoItem.MASTERS) | |
# save in the VSDX format | |
diagram.save("ReduceFileSize_Out.vsdx", SaveFileFormat.VSDX) | |
jpype.shutdownJVM() |