Free Support Forum - aspose.com

Visio page getting cropped in PNG/PDF output

Hi,

We are using Aspose.Diagram v19.12 for generating PNG/PDF output of visio pages. In the output, the visio page is getting cropped fom the top. So the content that was in the middle of the page now appears at the top.

It was working fine in earlier versions (tested with Aspsoe.Diagram v19.9), so it is a break in the latest version.

Following code is used to generate the PNG:

Diagram diagram = new Diagram("spring-overview.vsd");
String pageName = "Page-1";
Page srcPage = diagram.getPages().getPage(pageName);

int imageFormat = SaveFileFormat.PNG;
ImageSaveOptions options = new ImageSaveOptions(imageFormat);
options.setResolution(96);

int pageIndex = 0;
for (Page page : (Iterable) diagram.getPages()) {
	if (page.getID() == srcPage.getID()) {
		options.setPageIndex(pageIndex);
		options.setPageCount(1);
		break;
	}
	pageIndex++;
}
File outputFile = new File("output.png");
diagram.save(outputFile.getAbsolutePath(), options);

Please find attached the source visio file and it’s PNG output:
attachments.zip (118.9 KB)

Can you please look into this.

Thanks,
Neha

@Neha_Gautam

We have logged an issue as DIAGRAMJAVA-50680 in our issue tracking system for this. We will further check this issue in details and keep you informed with the status of rectification. Please be patient and spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as DIAGRAMJAVA-50680) have been fixed in Aspose.Diagram for Java 20.1.