We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Exception occurs when generating PNG of visio page

Hello,

I am using aspose.diagram v17.5.0 to generate PNG of page-'Page-2' of the attached visio file. Exception occurs when generating the PNG.

Following code is used to generate the PNG output:

Diagram diagram = new Diagram("test.vsdx");
String pageName = "Page-2";
Page srcPage = diagram.getPages().getPage(pageName);
File outputFile = new File("Page-2.png");
int imageFormat = SaveFileFormat.PNG;

int pageIndex = 1;
ImageSaveOptions options = new ImageSaveOptions(imageFormat);
options.setResolution(96);
for (Page page : (Iterable) diagram.getPages()) {
if (page.getID() == srcPage.getID()) {
options.setPageIndex(pageIndex);
options.setPageCount(1);
break;
}
pageIndex++;
}
diagram.save(outputFile.getAbsolutePath(), options);


Can you please analyse this issue.

Thanks,
Neha

Hi Neha,


Thank you for contacting support. We have tested your code in our environment, and it is showing a page index out of range error because you are setting the page index value as two. The page index starts from zero, since the right value is one. After setting the page index value to one, it shows a null pointer error. It has been logged under the ticket ID DIAGRAMJAVA-50505 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates. We are sorry for the inconvenience caused.

Hello,

I am using Aspose.Diagram v17.9.0 to verify this issue.
In the latest version, the output is getting generated but some MS SharePoint workflow items are rendered incorrectly.

PFA a screenshot of the issue:
comparison.png (46.0 KB)

Can you please analyse this issue.

Thanks,
Neha

@Neha_Gautam,
We managed to replicate the highlighted issue of shape corners in our environment. It has been logged under the ticket ID DIAGRAMJAVA-50551 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

@Neha_Gautam,
The linked ticket ID DIAGRAMJAVA-50551 has been resolved. If there is no issue in the quality assurance phase, then this fix will be included in the next version 17.10 of Aspose.Diagram for Java API. We will notify you once the new version is published.

@Neha_Gautam,
In reference to the ticket ID DIAGRAMJAVA-50551, please download and try the latest Hotfix version: Aspose.Diagram for Java 17.9.1 and let us know how that goes into your environment.

@Neha_Gautam,

The linked ticket ID DIAGRAMJAVA-50551 has been fixed. Please download and try the new version 17.10 of Aspose.Diagram for Java API.