Getting error when trying to watermark visio file

@philip.zhou

Getting error like this when trying to watermark visio files.

java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
at java.util.ArrayList.rangeCheck(ArrayList.java:659)
at java.util.ArrayList.get(ArrayList.java:435)
at com.aspose.diagram.PageCollection.get(Unknown Source)
at com.agile.plm.util.WatermarkUtils.WatermarkVisioFile(WatermarkUtils.java:338)
at TestWatermarkUtils.main(TestWatermarkUtils.java:22)


attaching the code used and sample vsdx file which gives the error

visiofiles.zip (438.4 KB)

Thanks
Sabarish

@sabkan
Thanks for the template file and sample code.
After an initial testing, I am able to reproduce the issue as you mentioned by using your template file. I found the issue of exception when adding watermark to visio.We need to evaluate your issue in details.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DIAGRAMJAVA-51192

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

ok. So is the code correct which I have used for watermarking Visio file?

Or do you have any other code which I can use for watermarking Visio files?

Thanks
Sabarish

@sabkan
Please change the pages count as this sample code then it will work fine and as expected:

  com.aspose.diagram.PageCollection visioPages = diagram.getPages();
  // Please change this line code
  int pages = visioPages.getCount(); //int pages = 100;
  for (int i = 0; i < pages; i++) {

Thanks.

@philip.zhou
Thanks it worked.

@sabkan
It is great that you were able to resolve this issue on your end. In case you have further inquiries or may need any help in future, please let us know by posting a new thread in Aspose.Diagram’ forum.
Thanks.