Create a Hyperlink for a Text Portion Introduction
Portion class has HyperlinkClick and HyperlinkMouseOver properties. You can set one of them to turn the portion into a hyperlink.
cURL Example
SDKs
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of Aspose.Slides Cloud SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.
SDK Examples
C#
string fileName = "MyPresentation.pptx" ;
int slideIndex = 1 ;
int shapeIndex = 2 ;
int paragraphIndex = 1 ;
int portionIndex = 1 ;
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
Portion dto = new Portion
{
HyperlinkMouseOver = new Hyperlink
{
ActionType = Hyperlink . ActionTypeEnum . JumpLastSlide
}
};
Portion portion = api . UpdatePortion ( fileName , slideIndex , shapeIndex , paragraphIndex , portionIndex , dto );
Console . WriteLine ( portion . HyperlinkMouseOver . TargetSlideIndex ); //5
Java
String fileName = "MyPresentation.pptx" ;
int slideIndex = 1 ;
int shapeIndex = 2 ;
int paragraphIndex = 1 ;
int portionIndex = 1 ;
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
Portion dto = new Portion ();
Hyperlink hyperlink = new Hyperlink ();
hyperlink . setActionType ( Hyperlink . ActionTypeEnum . JUMPLASTSLIDE );
dto . setHyperlinkMouseOver ( hyperlink );
Portion portion = api . updatePortion ( fileName , slideIndex , shapeIndex , paragraphIndex , portionIndex , dto , null , null , null , null );
System . out . println ( portion . getHyperlinkMouseOver (). getTargetSlideIndex ()); //5
PHP
use Aspose\Slides\Cloud\Sdk\Api\Configuration ;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi ;
use Aspose\Slides\Cloud\Sdk\Model\Portion ;
use Aspose\Slides\Cloud\Sdk\Model\Hyperlink ;
$config = new Configuration ();
$config -> setAppSid ( "MyClientId" );
$config -> setAppKey ( "MyClientSecret" );
$api = new SlidesApi ( null , $config );
$fileName = "MyPresentation.pptx" ;
$slideIndex = 1 ;
$shapeIndex = 2 ;
$paragraphIndex = 1 ;
$portionIndex = 1 ;
$dto = new Portion ();
$hyperlink = new Hyperlink ();
$hyperlink -> setActionType ( "JumpLastSlide" );
$dto -> setHyperlinkMouseOver ( $hyperlink );
$portion = $api -> updatePortion ( $fileName , $slideIndex , $shapeIndex , $paragraphIndex , $portionIndex , $dto );
print ( $portion -> getHyperlinkMouseOver () -> getTargetSlideIndex ()); //5
Ruby
Python
import asposeslidescloud
from asposeslidescloud.configuration import Configuration
from asposeslidescloud.apis.slides_api import SlidesApi
from asposeslidescloud.models.portion import Portion
from asposeslidescloud.models.hyperlink import Hyperlink
configuration = Configuration ()
configuration . app_sid = 'MyClientId'
configuration . app_key = 'MyClientSecret'
api = SlidesApi ( configuration )
file_name = "MyPresentation.pptx"
slide_index = 1
shape_index = 2
paragraph_index = 1
portion_index = 1
dto = Portion ()
hyperlink = Hyperlink ()
hyperlink . action_type = "JumpLastSlide"
dto . hyperlink_mouse_over = hyperlink
portion = api . update_portion ( file_name , slide_index , shape_index , paragraph_index , portion_index , dto )
print ( f "{portion.hyperlink_mouse_over.target_slide_index}" ) #5
Node.js
const CloudSdk = require ( "asposeslidescloud" );
const api = new CloudSdk . SlidesApi ( "MyClientId" , "MyClientSecret" );
const fileName = "MyPresentation.pptx" ;
const slideIndex = 1 ;
const shapeIndex = 2 ;
const paragraphIndex = 1 ;
const portionIndex = 1 ;
const dto = new CloudSdk . Portion ();
const hyperlink = new CloudSdk . Hyperlink ();
hyperlink . actionType = CloudSdk . Hyperlink . ActionTypeEnum . JumpLastSlide ;
dto . hyperlinkMouseOver = hyperlink ;
return api . updatePortion ( fileName , slideIndex , shapeIndex , paragraphIndex , portionIndex , dto ). then ( result => {
console . log ( result . body . hyperlinkMouseOver . targetSlideIndex ); //5
});
Go
cfg := asposeslidescloud . NewConfiguration ()
cfg . AppSid = "MyClientId"
cfg . AppKey = "MyClientSecret"
api := asposeslidescloud . NewAPIClient ( cfg )
fileName := "MyPresentation.pptx"
var slideIndex int32 = 1
var shapeIndex int32 = 2
var paragraphIndex int32 = 1
var portionIndex int32 = 1
dto := asposeslidescloud . NewPortion ()
hyperlink := asposeslidescloud . NewHyperlink ()
hyperlink . ActionType = "JumpLastSlide"
dto . HyperlinkMouseOver = hyperlink
portion , _ , e := api . SlidesApi . UpdatePortion ( fileName , slideIndex , shapeIndex , paragraphIndex , portionIndex , dto , "" , "" , "" , "" )
if e != nil {
fmt . Printf ( "Error: %v." , e )
return
}
fmt . Printf ( "Hyperlink Type: %v." , portion . GetHyperlinkMouseOver (). GetActionType ())
C++
Perl
Swift
SDK Source
The Aspose Cloud SDK’s can be downloaded from the following page: Available SDK’s