Rarraba gabatarwar [PowerPoint] (https://docs.fileformat.com/presentation/pptx/) zuwa ƙananan sassa na iya zama aiki mai mahimmanci ga mutane da yawa, musamman lokacin da ake mu’amala da tsayi da cikakkun bayanai. Wannan fasalin zai iya taimakawa wajen rarraba gabatarwa zuwa ƙananan sassa, mafi sauƙin sarrafawa, sauƙaƙe rabawa, gyara, da gabatarwa. Tare da ci gaban fasaha, rarrabuwar gabatarwar PowerPoint ana iya yin amfani da kayan aiki da hanyoyi daban-daban. A cikin wannan labarin, za mu tattauna yadda ake raba gabatarwar PowerPoint ta amfani da NET Cloud SDK, da kuma yadda wannan fasalin zai iya taimakawa wajen daidaita ayyukanku.
- Raba PowerPoint ta amfani da NET Cloud SDK
- Yadda ake Rarraba PPTX ta amfani da C#
- Rarraba PowerPoint ta amfani da Umarnin CURL
Raba PowerPoint ta amfani da NET Cloud SDK
Tare da Aspose.Slides Cloud SDK for .NET, yana da sauƙi a raba gabatarwar PowerPoint zuwa ƙananan sassa masu iya sarrafawa. Wannan API na tushen girgije an gina shi don daidaita tsarin aiki tare da fayilolin PowerPoint kuma yana ba da kewayon fasali don taimakawa sarrafa gabatarwa. Bugu da ƙari, yana ba da bayani mai ƙima wanda zai iya ɗaukar manyan gabatarwa tare da sauƙi, yana mai da shi zaɓi mai kyau ga masu haɓakawa da ke aiki tare da hadaddun gabatarwa.
Don farawa da wannan tsari, da fatan za a bincika ‘Aspose.Slides-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin Ƙara Kunshin. Abu na biyu, ƙirƙiri asusu a kan dashboard ɗin girgije kuma sami takaddun shaidar abokin ciniki na keɓaɓɓen ku. Don ƙarin bayani, da fatan za a ziyarci jagorar saurin farawa.
Yadda ake Rarraba PPTX ta amfani da C#
Da fatan za a duba snippet code mai zuwa, wanda ke taimaka mana mu raba fayilolin PPTX zuwa ƙarami, fayilolin da za a iya sarrafawa. Wannan hanya tana da taimako sosai kuma tana sauƙaƙa raba takamaiman nunin faifai ko sassan gabatarwa.
// 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);
// Karanta shigar da PowerPoint daga faifan gida
var inputPowerPoint = File.OpenRead("Cityscape monthly calendar.pptx");
// Kira API don raba PowerPoint daga nunin faifai 2 zuwa lamba ta 5
var responseStream = slidesApi.SplitOnline(inputPowerPoint, SlideExportFormat.Pptx,null,null, 2, 5);
// Ajiye fitowar rarraba PowerPoint zuwa faifan gida
using var pdfStream = File.Create("PowerPoint_Split_output.zip");
responseStream.CopyTo(pdfStream);
An bayar a ƙasa shine bayanin game da snippet code da aka bayyana a sama.
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
Ƙirƙiri misali na ajin SlidesApi inda muka wuce bayanan abokin ciniki azaman muhawara.
var inputPowerPoint = File.OpenRead("Cityscape monthly calendar.pptx");
Karanta abubuwan shigar da gabatarwar PowerPoint.
var responseStream = slidesApi.SplitOnline(inputPowerPoint, Aspose.Slides.Cloud.Sdk.Model.SlideExportFormat.Pptx,null,null, 2, 5);
Kira API don raba PowerPoint farawa daga lambar nunin faifai 2 zuwa lambar zamewar lamba 5. Ana dawo da fitarwa azaman .zip archive a tsarin Rafi.
using var pdfStream = File.Create("PowerPoint_Split_output.zip");
responseStream.CopyTo(pdfStream);
Ajiye sakamakon .zip archive zuwa rumbun gida.
Za a iya sauke gabatarwar PowerPoint da aka yi amfani da ita a cikin misalin da ke sama daga [Cityscape kalanda na wata-wata.pptx](https://create.microsoft.com/en-us/template/cityscape-monthly-calendar-f4e3e5c1-8862-46f6-82c7 -006b23119e76).
Rarraba PowerPoint ta amfani da Umarnin CURL
Hakanan yana yiwuwa a raba gabatarwar PowerPoint ta amfani da umarnin cURL. Lura cewa API ɗin yana ba da saitin ƙarshen ƙarshen waɗanda za a iya isa gare su ta amfani da umarnin cURL don aiwatar da ayyuka daban-daban, gami da rarrabuwar gabatarwar PowerPoint. Bugu da ƙari, amfani da umarnin cURL na iya zama zaɓi mai dacewa ga masu amfani waɗanda suka fi son musaya-layi ko buƙatar haɗa ayyukan cikin rubutun ko gudanawar aiki. Bugu da ƙari, ana iya amfani da shi akan kowane dandamali wanda ke goyan bayan cURL, gami da Windows, macOS, da Linux.
Da farko, da fatan za a aiwatar da umarni mai zuwa don samar da damar shigaToken dangane da bayanan abokin ciniki.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=ee170169-ca49-49a4-87b7-0e2ff815ea6e&client_secret=7f098199230fc5f2175d494d48f2077c" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Na biyu, da fatan za a aiwatar da umarni mai zuwa don fara aikin tsagawar PowerPoint wanda ya fara daga slide 3 zuwa slide 6.
curl -v "https://api.aspose.cloud/v3.0/slides/{inputPowerPoint}/split?format=Pptx&from=3&to=6&destFolder={destinationFolder}" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer <accessToken>" \
-H "Content-Type: application/json" \
-d "{}"
Sauya {inputPowerPoint}
tare da shigar da PowerPoint da aka riga an samu a ma’ajiyar gajimare. Sannan maye gurbin {accessToken}
tare da alamar samun damar JWT da ‘’{destinationFolder}’ tare da sunan babban fayil akan ma’ajiyar gajimare, wanda zai ƙunshi fitowar aikin rarraba PowerPoint.
Kammalawa
A ƙarshe, rarraba gabatarwar PowerPoint na iya zama muhimmin aiki don sarrafa manyan fayiloli ko cire takamaiman abun ciki. Tare da taimakon Aspose.Slides Cloud SDK don umarnin NET ko cURL, ana iya samun wannan tsari tare da sauƙi da sassauci. Duk hanyoyin biyu suna ba da fa’idodi na musamman, yana ba ku damar zaɓar wanda ya dace da bukatun ku. Bugu da ƙari kuma, Aspose.Slides Cloud SDK don .NET yana ba da sauƙi mai sauƙi kuma mai sauƙi tare da ƙwarewa mai mahimmanci, yayin da umarnin cURL yana ba da ƙarin iko mai mahimmanci kuma ana iya haɗawa cikin rubutun hadaddun. Ko da kuwa hanyar, rarrabuwar gabatarwar PowerPoint na iya taimakawa haɓaka ayyukan aiki da haɓaka yawan aiki.
Hanyoyin haɗi masu amfani
- Reference
- Jagorar Mai Haɓakawa
- SDK Source Code
- [Zauren Tallafawa Kyauta 6
- Live Demos
Labarai masu alaka
Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: