Abubuwan da ke gani suna taka muhimmiyar rawa a cikin sadarwa, gabatarwa, da ƙoƙarin tallace-tallace. PowerPoint gabatarwa galibi yana aiki azaman wadataccen tushen hotuna, zane-zane, da bayanan gani masu mahimmanci. Koyaya, fitar da waɗannan hotuna da hannu daga fayilolin PowerPoint na iya zama aiki mai cin lokaci da wahala. A nan ne ake buƙatar ingantaccen bayani don cire hotuna daga PowerPoint. Ta hanyar yin amfani da ikon .NET REST API, za ku iya daidaita wannan tsari kuma ku buɗe ɗimbin dama. A cikin wannan labarin, za mu bincika fa’idodi da mataki-mataki-mataki na cire hotuna daga PowerPoint ta amfani da .NET REST API, yana ba ku damar shiga cikin sauƙi da amfani da waɗannan hotuna a aikace-aikace da ayyuka daban-daban.
- API ɗin NET REST don Cire Hotuna daga PPT
- Cire Hotunan PowerPoint ta amfani da C#
- Zazzage Hotuna daga PowerPoint ta amfani da Umarnin CURL
API ɗin NET REST don Cire Hotuna daga PPT
Aspose.Slides Cloud SDK for .NET yana ba da mafita mai ƙarfi da inganci don cire hotuna daga gabatarwar PowerPoint. Tare da cikakkiyar tsarin sa na fasali da hanyoyin sauƙin amfani, zaku iya haɗa ƙarfin cire hoto a cikin aikace-aikacenku na NET.
Kawai bincika ‘Aspose.Slides-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin Ƙara Kunshin. Daga baya, ƙirƙiri asusu akan dashboard ɗin girgije kuma sami keɓaɓɓen bayanan abokin ciniki na keɓaɓɓen ku. Don ƙarin cikakkun bayanai, da fatan za a ziyarci sashin saurin farawa.
Cire Hotunan PowerPoint ta amfani da C#
Mun fahimci cewa ikon cire hotuna daga gabatarwar PowerPoint yana da mahimmanci ga yanayi daban-daban kuma a cikin wannan sashe, za mu yi amfani da snippet code C# .NET don cika wannan buƙatu.
// 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);
// Kira API don cire duk hotuna daga gabatarwar PowerPoint
var responseStream = slidesApi.DownloadImages("Cityscape monthly calendar.pptx", ImageExportFormat.Jpeg);
// Ajiye Hotunan da aka fitar 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 responseStream = slidesApi.DownloadImages("Cityscape monthly calendar.pptx", Aspose.Slides.Cloud.Sdk.Model.ImageExportFormat.Jpeg);
Kira API don cire duk hotunan PowerPoint a cikin tsarin JPEG. Ana mayar da fitar da wannan aikin azaman .zip archive a cikin tsarin Rafi.
using var pdfStream = File.Create("extractedImages.zip");
responseStream.CopyTo(pdfStream);
Ajiye sakamakon .zip archive zuwa rumbun gida.
Za a iya saukewa da shigar da gabatarwar PowerPoint da aka yi amfani da shi a cikin misalin da ke sama daga [Photography portfolio.pptx](https://create.microsoft.com/en-us/template/photography-portfolio-(modern-simple)-a714f435-0e16- 4279-801d-c675dc9f56e1).
Zazzage Hotuna daga PowerPoint ta amfani da Umarnin CURL
Hakanan zamu iya cim ma aikin cire hotuna ta amfani da umarnin cURL. Wannan tsarin yana ba da sassauci kuma yana ba ku damar yin hulɗa tare da Aspose.Slides Cloud API kai tsaye daga layin umarni ko haɗa shi cikin rubutun ku ko ayyukan aiki na atomatik. Don haka, ko kun fi son ƙirar layin umarni ko kuna son haɗa tsarin hakar cikin tsarin da kuke da shi, tsarin CURL yana ba da mafita mai ma’ana.
Yanzu da farko, aiwatar da umarni mai zuwa don samar da accessToken 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"
Mataki na biyu shine aiwatar da umarni mai zuwa don zazzage hotuna daga PowerPoint ta amfani da umarnin CURL.
curl -v "https://api.aspose.cloud/v3.0/slides/{inputPresentation}/images/download/Jpeg" \
-X POST \
-H "accept: multipart/form-data" \
-H "authorization: Bearer {accessToken}" \
-o "{extractedImages}"
Sauya {inputPresentation}
tare da sunan PowerPoint da aka riga ya samu a ma’ajiyar gajimare. Sauya {accessToken}
tare da alamar shiga JWT da {extractedImages}
tare da sunan .zip Rumbun da za’a samar akan tuƙi na gida.
Kammalawa
A ƙarshe, zazzage hotuna daga gabatarwar PowerPoint babban ƙarfi ne mai ƙima wanda zai iya haɓaka ayyukan sarrafa daftarin aiki. Ko ka zaɓi amfani da Aspose.Slides Cloud SDK don NET ko umarnin cURL, kuna da kayan aiki masu ƙarfi a wurin ku don cire hotuna cikin sauƙi. A takaice, Aspose.Slides Cloud SDK yana ba da cikakkiyar tsari na fasali da ayyuka da aka tsara musamman don aiki tare da fayilolin PowerPoint, yana ba da ƙwarewar haɗin kai ga masu haɓaka NET. A gefe guda, umarnin cURL yana ba da tsari mai sauƙi kuma mai dacewa, yana ba ku damar yin hulɗa tare da Aspose.Slides Cloud API kai tsaye daga layin umarni.
Ko wace hanya kuka zaɓa, zaku iya da kwarin gwiwa zazzage hotuna daga gabatarwar PowerPoint kuma buɗe sabbin damar yin amfani da hoto, bincike, ko haɗin kai tare da wasu tsarin.
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: