Free Support Forum - aspose.com

No access to page 2 in Diagram

Hello aspose team!

I’m using aspose diagram for java 20.6 to read a certain visio file (attached).
The file has two pages named “Zeichenblatt-1” and “FPU_FAULT_C1_VIP”.

Using the code

Diagram dgrm = new Diagram(dir + "MFC_FPU_FAULT_C1.vsd");
System.out.println("num pages: " + dgrm.getPages().getCount());

outputs 1 and I can access exactly the first page.

The first page is empty in that file however and I try to implement an iterator that loops over all pages to extract the first page that is not empty.

Thanks for pointing out a solution,
regards, Martin

MFC_FPU_FAULT_C1.zip (28.9 KB)

@martin.n

We have tested the scenario in our environment using Aspose.Diagram for Java 20.6 and your shared file. We were unable to notice any issue. Please check attached screenshot for your reference.

PageCount.png (10.6 KB)

Would you please make sure that you are using a valid license at your end. In case you still face any issue, please share your sample console application with us so that we can again test the scenario in our environment and address it accordingly.

Hello, thanks for your reply.

I will attach my application since I see only one page nevertheless.
PageCount1.png (36.0 KB)

Tested with JDK 1.8.0_141 and 1.8.0_251

Here is my application:
_visio-test.zip (3.1 MB)

I see no difference to your code. Is there anything else I can test which could make the loading different?

Regards,
Martin Nerlich

@martin.n

The difference is license setting code missing in your application. Please use a valid license, as requested earlier in our previous reply, in order to get correct results:

com.aspose.diagram.License dlic = new com.aspose.diagram.License();
dlic.setLicense(dataDir + "Aspose.Total.Java.lic");

In case you do not have license, you can get a free 30-days temporary license to evaluate the API without any limitation.

Hello @asad.ali, thank you for pointing that out. I’m sorry I missed that in your first answer.
I can access all pages now when running with the license initialized.

@martin.n

It is good to know that your issue has been resolved. Please keep using our API and in case you face any issue, please feel free to let us know.