Free Support Forum -

Setting AutoFitPageToDrawingContent does not fit to page content



I am running the code example from ->

with Aspose.Diagram 19.1.0 Version:

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 - 2.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

However, i could not manage to get the saved file fitting to the page like i would do in Microsoft Visio application -> Design -> Size -> Fit to Drawing

I have attached screenshots of input and result files.

Pleas let me know if i am missing something?

Many thanks in advance,
best regards

input.PNG (21.6 KB)

result.PNG (25.8 KB)



Thanks for contacting support.

We have tested the scenario in our environment and obtained different output as result (i.e. (32.0 KB)). However, we did notice that the page was not fit to drawing content as it was obtained using MS Visio.

We have logged this issue as DIAGRAMNET-51613 in our issue tracking system for the sake of correction. We will let you know as soon as some definite updates are available regarding its rectification. Please be patient and spare us little time.

We are sorry for the inconvenience.


Thanks very much and take your time, i am waiting for your update.



Thanks for your feedback.

We will surely notify you as soon as any update is available regarding ticket resolution.