Exception : Slide ID for hyperlink can't be smaller than 256

Hi Aspose comunity,

When i try to add a hyperlink to a picture a got the following exception : Slide ID for hyperlink can’t be smaller than 256.

Exception in thread “main” com.aspose.slides.PptPropertyException: Slide ID for hyperlink can’t be smaller than 256
at com.aspose.slides.Link.setInternalHyperlink(SourceFile:356)
at ma.mega.modeling.ppt.export.ExportToPowerPoint.setPptStyle(ExportToPowerPoint.java:110)
at ma.mega.modeling.ppt.export.ExportToPowerPoint.convertDiagramToImage(ExportToPowerPoint.java:83)
at ma.mega.modeling.ppt.export.ExportToPowerPoint.browseObjects(ExportToPowerPoint.java:50)
at ma.mega.modeling.ppt.export.ExportToPowerPoint.createAndSavePresentation(ExportToPowerPoint.java:154)
at ma.mega.modeling.ppt.export.Test.main(Test.java:26)

This is my code :

FileInputStream backIn = new FileInputStream(“c:/back.png”);
Picture backPic = new Picture(ppt, backIn);
int backId = ppt.getPictures().add(backPic);
PictureFrame picFrame = slide.getShapes().addPictureFrame(backId, 100, 580, 420, 390);
picFrame.addLink().setInternalHyperlink(LinkJumpType.PREVIOUS_SLIDE);

I will be grateful to anyone who will help me.

Thanks.


I’m working with Aspose 2.7 + Jre 1.6

Hi,
Thanks for using Aspose.Slides,

Each shape contains Link property which you can use.

// simple jump to Next or Previous slides
Link link = picFrame.addLink();
link.setJump(LinkJumpType.PREVIOUS_SLIDE);


// link to any slide in a presentation
Link link = picFrame.addLink();
link.setInternalHyperlink(pres.getSlideByPosition(2));

// web link
Link link = picFrame.addLink();
link.getExternalHyperlink(“http://www.aspose.com”);


Hope I could able to help you.
Best Regards

Thank you very much hassan.

It works.

Best Regards