A cikin duniyar yau mai saurin tafiya, ƙirƙira mai ƙarfi da jan hankali PowerPoint gabatarwa ya zama mahimmanci ga kasuwanci, malamai, da ƙwararru. Koyaya, ƙara nunin faifai da hannu zuwa gabatarwa na iya ɗaukar lokaci da maimaituwa, musamman lokacin da ake mu’amala da manyan ayyuka ko sabuntawa akai-akai. Wannan shine inda ƙarfin aiki da kai ke shigowa. Ta hanyar haɓaka ƙarfin .NET REST API, zaku iya daidaita tsarin ƙara nunin faifan PowerPoint cikin tsari, adana lokaci da ƙoƙari mai mahimmanci. A cikin wannan labarin, za mu bincika mahimmancin wannan fasalin kuma mu nuna yadda ake amfani da Aspose.Slides Cloud SDK don NET don haɗa sabbin nunin faifai a cikin gabatarwar PowerPoint ɗinku na yanzu.
- API ɗin Processing REST
- Ƙara Slide zuwa PowerPoint ta amfani da C# .NET
- Yadda ake Ƙara Slide a PowerPoint ta amfani da Umarnin CURL
API ɗin Processing REST
Aspose.Slides Cloud SDK for .NET yana ba da cikakkiyar bayani mai ƙarfi don sarrafa gabatarwar PowerPoint. Tare da ɗimbin fasalulluka da API ɗin da ke da hankali, yana ba ku damar haɗa ƙirƙira nunin faifai da damar yin magudi a cikin aikace-aikacenku na NET. Ko kuna son ƙara nunin faifan ɗaiɗaikun ɗaiɗaiku ko gabaɗayan faifan faifai, wannan .NET REST API yana ba da hanyoyi da ayyuka da yawa don biyan takamaiman buƙatunku.
Ta hanyar tsara shirye-shirye don samar da nunin faifai masu kyan gani, yi amfani da tsarawa, ƙara abun ciki, har ma da haɗa abubuwan multimedia kamar hotuna na raster ko SVG, WordArt, SmartArt graphics da sauransu.
Yanzu, don amfani da SDK, da farko muna buƙatar bincika ‘Aspose.Slides-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Abu na biyu, ziyarci sashin saurin farawa don bayani kan yadda ake ƙirƙirar asusu akan dashboard ɗin girgije (muna buƙatar bin waɗannan umarnin saboda, muna buƙatar samar da abokin ciniki. takardun shaida).
Ƙara Slide zuwa PowerPoint ta amfani da C# .NET
Tare da ƴan layukan lamba, zaku iya ƙara nunin faifai ta tsari zuwa gabatarwar data kasance. Da fatan za a duba snippet code mai zuwa, saboda yana ba da sassauƙa da daidaitacce hanya don sarrafa tsarin ƙirƙirar nunin faifai. Bugu da ƙari, yana kuma ba ku damar ƙirƙirar gabatarwar da aka keɓance da ta dace da takamaiman bukatunku.
// 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 = "3D PowerPoint Hubble Telescope model.pptx";
// sabon Slide index
int newSlideIndex = 4;
// kira API don ƙara nunin faifai zuwa gabatarwar PowerPoint
var responseStream = slidesApi.CreateSlide(sourcePPTX,null, newSlideIndex);
Bari mu bincika snippet code da ƙarin cikakkun bayanai.
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
Ƙirƙiri wani abu na ajin SlidesApi inda muka wuce bayanan abokin ciniki azaman muhawara.
slidesApi.CreateSlide(sourcePPTX,null, newSlideIndex);
Kira API don ƙara nunin faifai a fihirisar da aka bayar. Idan ma’aunin matsayi ya ɓace, to ana ƙara zamewar zuwa ƙarshen gabatarwar.
Za a iya sauke samfurin PowerPoint da aka yi amfani da shi a cikin misalin da ke sama kyauta daga 3D PowerPoint Hubble Telescope model.pptx f9f9485d-2a41-4eef-9ef0-1abc88fa3c8d).
Yadda ake Ƙara Slide a PowerPoint ta amfani da Umarnin CURL
Ƙara nunin faifan PowerPoint kuma za’a iya samun nasara ta amfani da umarnin cURL tare da Aspose.Slides Cloud. Tare da API ɗin RESTful wanda Aspose.Slides Cloud ke bayarwa, zaku iya yin buƙatun HTTP ta amfani da umarnin cURL don yin hulɗa tare da gabatarwar PowerPoint. Wannan tsarin yana ba da sassauci kuma yana ba da damar haɗin kai tare da harsunan shirye-shirye da dandamali daban-daban. Don haka, ko kun fi son yin amfani da umarnin cURL kai tsaye ko haɗa su cikin rubutunku ko aikace-aikacenku, kuna iya yin amfani da ikon Aspose.Slides Cloud don sarrafa da sarrafa nunin faifan PowerPoint yadda ya kamata.
Da farko, muna buƙatar aiwatar da umarni mai zuwa don samar da alamar samun damar JWT:
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 umarnin cURL mai zuwa don ƙara sabon zamewa a fihirisar # 4.
curl -v "https://api.aspose.cloud/v3.0/slides/{sourcePPTX}/slides?position=4" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-d {}
Sauya ‘sourcePPTX’ tare da sunan shigarwar PowerPoint da aka riga an samu a ma’ajiyar girgije, da ‘accessToken’ tare da alamar samun damar JWT da aka samar a sama.
Kammalawa
A ƙarshe, ikon ƙara nunin faifai na PowerPoint da tsari yana buɗe duniyar yuwuwar yin aiki da kai da haɓaka ayyukan gabatarwar ku. Ko kun zaɓi yin amfani da Aspose.Slides Cloud SDK don NET ko yin amfani da umarnin cURL tare da Aspose.Slides Cloud, kuna da kayan aiki masu ƙarfi a wurin ku don haɗa ayyukan ƙari na faifai a cikin aikace-aikacenku da tsarinku. Wannan damar tana ba ku damar samar da gabatarwar a hankali, da sarrafa abun ciki na silide da kyau yadda ya kamata. Koyaya, ta hanyar amfani da ƙarfin waɗannan fasahohin, zaku iya daidaita tsarin ƙirƙirar PowerPoint ɗinku, adana lokaci da ƙoƙari, da gabatar da gabatarwa masu kayatarwa da jan hankali.
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: