Please also use the following code for page size and orientation purposes:
[Java]
// 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); // set orientation of the page
diagram.getPages().getPage(“Page-1”).getPageSheet().getPrintProps().getPrintPageOrientation().setValue(PrintPageOrientationValue.PORTRAIT);
// save Visio
diagram.save(“C:/tmp/Output.vsdx”, SaveFileFormat.VSDX);
Please let us know in case of any further assistance or questions.
Thank you for the details. You’re correct that the PrintPageOrientation property does not act as expected. We’ve logged this problem under ticket id DIAGRAMJAVA-50300 in our bug tracking system. Your post has also been linked to this ticket. We’ll keep you informed regarding any available updates. As a workaround, please set page size by interchanging the values of width and height properties. Please use this sample code:
[Java]
// load Visio
Diagram result = new Diagram(“C:/AD/test593/test_orient.vsd”); // iterate through the pages
for (Object obj : result.getPages())
{
Page page = (Page) obj; // get height of the page double height = page.getPageSheet().getPageProps().getPageHeight().getValue(); // get width of the page double width = page.getPageSheet().getPageProps().getPageWidth().getValue();
// interchange height and width
page.getPageSheet().getPageProps().getPageHeight().setValue(width);
page.getPageSheet().getPageProps().getPageWidth().setValue(height); } // save Visio
result.save(“C:/AD/test593/test_orient05.vdx”, SaveFileFormat.VDX);
Thank you for being patient. We have a good news for you that the issue id DIAGRAMJAVA-50300 has now been resolved. If there is no issue in the QA phase, then this fix will be incorporated in the next version 6.1.0 of the Aspose.Diagram for Java API. We'll inform you via this forum thread as soon as the new release is published.