We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

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);

I will be grateful to anyone who will help me.


I’m working with Aspose 2.7 + Jre 1.6

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 to any slide in a presentation
Link link = picFrame.addLink();

// web link
Link link = picFrame.addLink();

Hope I could able to help you.
Best Regards

Thank you very much hassan.

It works.

Best Regards