Visio Zoom and Pan Positioning

Hi Team,
I am trying to set the zoom level and pan position on a Visio page. I am able to set the zoom level using page.ViewScale = 1 , but I cannot find any property to set the pan location( blue box). Please inform me if there is any available property through Aspose to set the pan position on a page

Pan position.png (30.9 KB)

Regards,
Uday

@usarigamala
Please refer to this sample code to set the location of the view center:

        diagram.Pages[0].ViewScale = 1.85;
        diagram.Pages[0].ViewCenterX = 1;
        diagram.Pages[0].ViewCenterY = -1;
        diagram.Windows[0].ViewScale = 1.85;
        diagram.Windows[0].ViewCenterX = 1;
        diagram.Windows[0].ViewCenterY = -1; 

Thanks.

Hi Team,

I have tried generating the visio using the code provided, but diagram.Windows has no elements. It throws out of range exception. Please let me know if I am missing anything.

Regards,
Uday

@usarigamala
Please try this code to add a window to diagram first:
Window window = new Window();
window.ID = diagram.Windows.Add(window);

Thanks.

Hi Team,

With the given code , the Pan is still positioned at the bottom left corner of Visio page.
Please provide any other solution.
image.png (22.1 KB)

Regards,
Uday

@usarigamala
Thanks for the screenshots.
I am sorry i could not reproduce the issue as you mentioned by using the following sample code.
Please check the input and output file.
You will find that the panning position is different.files.zip (43.0 KB)

Could you please share your input file and we will look further into it.
Also, please share your current sample code (if you are using) which you are using to try to set pan position.

Thanks.