How convert each page to a separate svg file? (Nodejs)

Hi, I need to take each page of a visio file and generate a new svg file for each page. How can this be done?

@sintez
Please try this sample code:

        Aspose.Diagram.Saving.SVGSaveOptions o = new SVGSaveOptions();
        for (int i = 0; i < diagram.Pages.Count;i++ )
        {
            o.PageIndex = i;
            diagram.Save(  "Output" + i + ".svg", o);
        }

Thanks.

Tried to do this using nodejs, but often aspose didn’t find the pages (and they are there)

@sintez
The sample code of nodejs via java:

var saveOp = new aspose.diagram.SVGSaveOptions();
for (var i = 0; i < diagram.getPages().getCount(); i++)
{
    saveOp.setPageIndex(i);
    d.save("Output" + i + ".svg"), saveOp);
}

If you find the issue of “could not find the pages”,Could you please share the template file and your current code that you are using. we will check it soon.