Can we inset image in pptx file with some hyperlink, so that if user click on image it will redirect the user to the new window.
Hi,
Thanks for inquiring Aspose.Slides.
I have observed the requirements shared by you and request you to please try using following sample code to serve the purpose on your end.
public static void testImageHyperlink(){//Instantiate Prseetation class that represents the PPTXPresentation pres = new Presentation();//Get the first slideISlide sld = pres.getSlides().get_Item(0);//Instantiate the Image classIPPImage imgx =null;try{imgx = pres.getImages().addImage(new FileInputStream(new File(“asp.jpg”)));}catch(IOException e){}//Add Picture Frame with height and width equivalent of PictureIPictureFrame picFrm=sld.getShapes().addPictureFrame(ShapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx);//Write the PPTX file to disk//Set Hyperlink for the imageIHyperlinkManager HypMan = picFrm.getHyperlinkManager();HypMan.setExternalHyperlinkClick(“http://www.aspose.com”);pres.save(“RectPicFrame.pptx”, SaveFormat.Pptx);}
I hope this will be helpful. Please share, if I may help you further in this regard.
Many Thanks,