A cikin duniyar yau mai saurin tafiya, isar da gabatarwa mai kayatarwa yana da mahimmanci don sadarwa da ra’ayoyin ku yadda ya kamata da kuma ɗaukar hankalin masu sauraron ku. Wata dabara mai ƙarfi wacce za ta iya haɓaka sha’awar gani na [PowerPoint] (https://docs.fileformat.com/presentation/pptx/) ita ce amfani da rayarwa. raye-raye suna kawo nunin faifan ku zuwa rayuwa, suna ƙara ruwa, kuzari, da ƙwararrun taɓa abun cikin ku. Ko kuna son haskaka mahimman bayanai, nuna matakai, ko ƙirƙirar sauye-sauye tsakanin nunin faifai, raye-raye suna taka muhimmiyar rawa wajen ƙirƙirar gabatarwa mai jan hankali na gani. A cikin wannan labarin, za mu shiga cikin duniyar raye-rayen PowerPoint kuma mu bincika yadda za mu iya yin amfani da damar .NET REST API.
- API ɗin NET REST don Animation na PowerPoint
- Ƙara Animation zuwa PowerPoint ta amfani da C# .NET
- Saka Animation a cikin PowerPoint ta amfani da Umarnin CURL
API ɗin NET REST don Animation na PowerPoint
Idan ya zo ga yin amfani da ikon rayarwa a cikin gabatarwar PowerPoint, Aspose.Slides Cloud SDK for .NET ingantaccen bayani ne kuma mai wadatar fasali. Wannan SDK mai ƙarfi yana ba da cikakkiyar saitin kayan aiki da ayyuka don aiki tare da fayilolin PowerPoint cikin tsari, gami da ikon sakawa da sarrafa abubuwan rayarwa ba tare da wahala ba. Yana ba ku damar cimma ingantattun sakamako na pixel da isar da gabatarwa mai ban sha’awa na gani waɗanda ke jan hankalin masu sauraron ku.
Don fara amfani da wannan SDK, muna buƙatar bincika farkon binciken ‘Aspose.Slides-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Har ila yau, muna buƙatar ƙirƙirar asusu akan cloud dashboard, inda za mu sami keɓaɓɓen shaidar abokin ciniki.
Kuna iya la’akari da ziyartar farawa da sauri don duk cikakkun bayanai kan yadda ake ƙirƙirar asusu akan dashboard ɗin girgije.
Ƙara Animation zuwa PowerPoint ta amfani da C# .NET
Da fatan za a yi amfani da snippet na lamba mai zuwa don ƙara rayarwa zuwa gabatarwar PowerPoint.
// Don ƙarin misalai, da fatan za a ziyarci https://github.com/aspose-slides-cloud
// Samu bayanan abokin ciniki daga https://dashboard.aspose.cloud/
string clientSecret = "7f098199230fc5f2175d494d48f2077c";
string clientID = "ee170169-ca49-49a4-87b7-0e2ff815ea6e";
// ƙirƙirar misali na SlidesApi
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
// sunan shigar da gabatarwar PowerPoint
string sourcePPTX = "Inspirational bookmarks.pptx";
// index of slide inda muke buƙatar ƙara rayarwa
int slideIndex = 1;
// Ƙirƙiri wani abu na ajin Effect inda muke ayyana kaddarorin rayarwa
Effect dto = new Effect
{
Type = Effect.TypeEnum.Boomerang,
ShapeIndex = 1,
ParagraphIndex = 1,
RepeatCount = 2
};
// kira API don ƙara rayarwa zuwa nunin farko na gabatarwar PowerPoint
slidesApi.CreateAnimationEffect(sourcePPTX, slideIndex, dto);
// karanta kaddarorin da aka ƙera zuwa sabbin abubuwan raye-raye
SlideAnimation animation = slidesApi.GetAnimation(sourcePPTX, slideIndex, 1, 1);
Console.WriteLine(animation.MainSequence.Count); //1
An ba da cikakkun bayanai game da snippet code na sama.
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
Ƙirƙiri wani abu na ajin SlidesApi inda muka wuce bayanan abokin ciniki azaman muhawara.
Effect dto = new Effect
{
Type = Effect.TypeEnum.Boomerang,
ShapeIndex = 1,
ParagraphIndex = 1,
RepeatCount = 2
};
Ƙirƙiri misali na ajin Effect inda muke ayyana nau’in tasirin rayarwa, siffa da fihirisar sakin layi inda ake buƙatar amfani da rayarwa.
slidesApi.CreateAnimationEffect(sourcePPTX, slideIndex, dto);
Kira API don ƙara rayarwa zuwa nunin farko na gabatarwar PowerPoint.
In ba haka ba, mun ƙirƙiri misali na ajin ‘SlideAnimation’, wanda ke ba mu damar karanta bayanan raye-raye.
Kuna iya yin la’akari da zazzage samfurin PowerPoint da aka yi amfani da shi a cikin misalin da ke sama daga Bookmarks.pptx .
Saka Animation a cikin PowerPoint ta amfani da Umarnin CURL
Hakanan zamu iya cim ma aikin shigar da rayarwa a cikin PowerPoint ta amfani da umarnin cURL tare da API Aspose.Slides Cloud. API ɗin Aspose.Slides Cloud yana ba da cikakkiyar saiti na ƙarshen ƙarshen RESTful wanda ke ba mu damar yin ayyuka daban-daban akan fayilolin PowerPoint, gami da ƙara raye-raye. Tare da umarnin cURL, za mu iya yin buƙatun HTTP zuwa wuraren ƙarshen API kuma mu yi hulɗa tare da sabis na Aspose.Slides Cloud.
Lura cewa amfani da wannan hanyar yana ba mu sassauci don haɗa ayyukan motsin rai na PowerPoint cikin aikace-aikacenmu ko rubutun mu ta amfani da yarukan shirye-shirye da yawa waɗanda ke goyan bayan cURL. Yanzu, matakin farko na wannan hanyar shine samar da alamar samun damar JWT. Don haka, da fatan za a aiwatar da umarni mai zuwa:
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Yanzu, aiwatar da umarni mai zuwa don ƙara nau’in wasan kwaikwayo na nau’in ‘CurveUpDown’ zuwa nunin farko na PowerPoint.
curl -v "https://api.aspose.cloud/v3.0/slides/{myPowerPoint.pptx}/slides/1/animation" \
-X PUT \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "{ \"MainSequence\": [ { \"Type\": \"CurveUpDown\", \"Subtype\": \"None\", \"PresetClassType\": \"Entrance\", \"ShapeIndex\": 1, \"ParagraphIndex\": 1, \"TriggerType\": \"AfterPrevious\", \"Accelerate\": 0, \"AutoReverse\": true, \"Decelerate\": 0, \"Duration\": 0, \"RepeatCount\": 0, \"RepeatDuration\": 0, \"Restart\": \"Always\", \"Speed\": 1, \"TriggerDelayTime\": 0, \"RepeatUntilEndSlide\": true, \"RepeatUntilNextClick\": true, \"StopPreviousSound\": true } ], \"InteractiveSequences\": [ { \"Effects\": [ { \"Type\": \"CurveUpDown\", \"Subtype\": \"None\", \"PresetClassType\": \"Entrance\", \"ShapeIndex\": 1, \"ParagraphIndex\": 1, \"TriggerType\": \"AfterPrevious\", \"Accelerate\": 0, \"AutoReverse\": true, \"Decelerate\": 0, \"Duration\": 0, \"RepeatCount\": 0, \"RepeatDuration\": 0, \"Restart\": \"Always\", \"Speed\": 0, \"TriggerDelayTime\": 0, \"RepeatUntilEndSlide\": true, \"RepeatUntilNextClick\": true, \"StopPreviousSound\": true } ], \"TriggerShapeIndex\": 1 } ]}"
Sauya myPowerPoint.pptx
da sunan shigar da PowerPoint da aka rigaya akwai a cikin ma’ajiyar girgije, da ‘accessToken’ tare da alamar samun damar JWT da aka samar a baya.
Kammalawa
A ƙarshe, ƙara rayarwa zuwa gabatarwar PowerPoint yana haɓaka tasirinsu na gani kuma yana jan hankalin masu sauraro cikin yanayi mai ƙarfi da mu’amala. Ko kun zaɓi yin amfani da Aspose.Slides Cloud SDK don NET ko umarnin cURL tare da Aspose.Slides Cloud API, duka hanyoyin suna ba da ingantattun hanyoyi masu sassauƙa don cimma wannan buƙatu.
Bugu da ƙari kuma, Aspose.Slides Cloud SDK don .NET yana ba da cikakkiyar tsari na fasali da hanyoyi masu dacewa don yin aiki tare da raye-rayen PowerPoint ta hanyar shirye-shirye, yayin da umarnin cURL ya ba da hanya mai dacewa da dandamali mai zaman kanta don yin hulɗa tare da Aspose.Slides Cloud API. Don haka, ƙirƙiri abubuwan gani masu jan hankali, da kuma isar da gabatarwa mai tasiri, a yau.
Hanyoyin haɗi masu amfani
- Jagorar Mai Haɓakawa
- Reference
- SDK Source Code
- [Zauren Tallafawa Kyauta 6
- Live Demos
Labarai masu alaka
Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: