Free Support Forum - aspose.com

How to set page size?

Using the Java Aspose.Diagram library, how do you set page size? I’m trying to change mine to 11x17 in.

@bt5241

Thanks for contacting support.

Please use following code snippet to set the page size of a Diagram:

// load Visio
Diagram diagram = new Diagram(“C:/tmp/test.vsdx”);
// set height of the page
diagram.getPages().getPage(“Page-1”).getPageSheet().getPageProps().getPageHeight().setValue(8);
// set width of the page
diagram.getPages().getPage(“Page-1”).getPageSheet().getPageProps().getPageWidth().setValue(11); 

In case you still face any issue, please share your sample input diagram with us. We will test the scenario in our environment and address it accordingly.

Thank you, it looks like that did it