Drawing.vsd has 3 pages. But below code only can get one page. If I save vsd as vdx, below code can get all pages.
// The path to the documents directory.
String dataDir = Utils.getDataDir(ExportToHTML.class);
// Call the diagram constructor to load diagram from a VSD file
Diagram diagram = new Diagram(dataDir+ "drawing.vsd");
PageCollection pages = diagram.getPages();
Hi Hugh,
Thank you for contacting support and using Aspose.Diagram API. Please provide the zip archive of the Visio diagram in this forum thread. We’ll investigate and reply you appropriately.
Hi Hugh,
Thank you for the details. We have tested your Visio diagram against the latest version 6.1.0 of Aspose.Diagram API and unable to get page count as one. It returns the page count as three. It appears as you are using an old version of Aspose.Diagram API. Please download and use
the latest version 6.1.0 of Aspose.Diagram for Java API, and then let us know how that goes on your side.
We’re looking forward to help you.
I did use the latest verion of Aspose.Diagram. Below is my maven configuration.
com.aspose
aspose-diagram
6.1.0
I also check the jar file which is D:.m2\repository\com\aspose\aspose-diagram\6.1.0\aspose-diagram-6.1.0.jar
Hi Hugh,
Thank you for the details. Please give details of your working environment, e.g. JDK version and build number, IDE (eclipse or NetBeans), application type and any other information which you think is helpful in replicating the problem on our side. It would be great if you can prepare a simple Java application project, which reproduces this problem on your side and attach its zip archive in this forum thread. We’ll investigate and reply you appropriately.
On our side, the source code and the result are as follows:
[Java]
// Call the diagram constructor to load diagram from a VSD file
Diagram dgm = new Diagram(“C:\AD\test615\” + “drawing.vsd”);
// get pages collection
PageCollection pages = dgm.getPages();
// display pages count
System.out.println(“Page Count:” + pages.getCount());
Result:
Page Count:3
package com.aspose.diagram.examples.Diagrams;
import com.aspose.diagram.*;
import com.aspose.diagram.examples.Utils;
public class ExportToHTML
{
public static void main(String[] args) throws Exception
{
// The path to the documents directory.
String dataDir = Utils.getDataDir(ExportToHTML.class);
// Call the diagram constructor to load diagram from a VSD file
Diagram diagram = new Diagram(dataDir+ "drawing.vsd");
PageCollection pages = diagram.getPages();
// Save as HTML
diagram.save(dataDir+ "Output.html", SaveFileFormat.HTML);
}
}
Hi Hugh,
Thank you for the snapshot. The size is one because you have not applied the Aspose license in the code. Without applying Aspose license, Aspose.Diagram library implements the evaluation limitations like only read the first page. It shows three after applying the Aspose license.
We hope, this helps. Please let us know in case of any confusion or questions.
It works after apply the license
Hi Hugh,
Thank you for the confirmation. It is nice to hear from you that the problem has been resolved. Please let us know if you require any further assistance, we will be happy to help you.