Exemple #1
0
        public static void Run()
        {
            // ExStart:UseDiagramSaveOptions
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_LoadSaveConvert();

            // Call the diagram constructor to a VSDX diagram
            Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");

            // Options when saving a diagram into Visio format
            DiagramSaveOptions options = new DiagramSaveOptions(SaveFileFormat.VSDX);

            // Summary:
            //     When characters in the diagram are unicode and not be set with correct font
            //     value or the font is not installed locally, they may appear as block,
            //     image or XPS.  Set the DefaultFont such as MingLiu or MS Gothic to show these
            //     characters.
            options.DefaultFont = "MS Gothic";

            // Summary:
            //     Defines whether need enlarge page to fit drawing content or not.
            // Remarks:
            //     Default value is false.
            options.AutoFitPageToDrawingContent = true;

            diagram.Save(dataDir + "UseDiagramSaveOptions_out.vsdx", options);
            // ExEnd:UseDiagramSaveOptions
        }
        public static void Run()
        {
            // ExStart:AutoFitShapesInVisio
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Diagrams();

            // Load a Visio diagram
            Diagram diagram = new Diagram(dataDir + "BFlowcht.vsdx");

            // Use saving options
            DiagramSaveOptions options = new DiagramSaveOptions(SaveFileFormat.VSDX);
            // Set Auto fit page property
            options.AutoFitPageToDrawingContent = true;

            // Save Visio diagram
            diagram.Save(dataDir + "AutoFitShapesInVisio_out.vsdx", options);
            // ExEnd:AutoFitShapesInVisio
        }
        public static void Run()
        {
            //ExStart:AutoFitShapesInVisio
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Diagrams();

            // load a Visio diagram
            Diagram diagram = new Diagram(dataDir + "BFlowcht.vsdx");

            // use saving options
            DiagramSaveOptions options = new DiagramSaveOptions(SaveFileFormat.VSDX);

            // set Auto fit page property
            options.AutoFitPageToDrawingContent = true;

            // save Visio diagram
            diagram.Save(dataDir + "AutoFitShapesInVisio_Out.vsdx", options);
            //ExEnd:AutoFitShapesInVisio
        }