Hi,
Diagram diagram = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”> Diagram(“c:\temp\Input.vsd”);<br style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”><span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
<span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>// use saving options<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
DiagramSaveOptions options = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”> DiagramSaveOptions(SaveFileFormat.VSDX);
<span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>// set Auto fit page property<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>options.AutoFitPageToDrawingContent = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>false<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>;<br style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”><span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
<span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>// save Visio diagram<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
diagram.Save(“c:\temp\Output.vsdx”, options);<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
kit.net:I noticed when I open the result file in Visio, that the AutoSize button is selected, despite the logic to set options.AutoFitPageToDrawingContent = false.So I reset the button in Visio, then select the connector; it jumps to position when I use the arrow key to move it up, then down, and this time the page size did not change. In fact, the connector jumps to position when I move a connected shape as well.So I suspect the page size issue is not really related to the initial position of the connectors, which is the main issue.
kit.net:Visio supports attaching Connector endpoints with "glue" to any point along the edge of a Shape. Is there no way to accomplish this with the Aspose API?
Hi,
Thank you for your response.
Hi,
Did you mean the stencil file of shapes? If so, then yes, because we shall investigate and see if it is already supported or not. It may possible that we also log an enhancement to achieve the said requirement. We recommend our clients share the complete details (including source Visio, stencil file if any, and code) of a use case so that we could replicate it on our side. It will help us investigate and reply to you appropriately.
I just learned that the stencils I am using in Visio are composed (by someone else) of shapes that provide the multiple glue points around the edge, as found with right-click > Show ShapeSheet.
I have further confirmed that the problem of connector position initially 1.5" too low is resolved by using an updated version of Aspose.Diagram.dll v17.3.2.0.
Hi,