cire rubutu mai ƙarfi

Yadda ake Cire rubutu daga PowerPoint ta amfani da NET REST API.

A fagen sarrafa bayanai na zamani, gabatarwar PowerPoint sun zama hanyar raba bayanai a ko’ina, da isar da gabatarwa mai tasiri, da isar da ra’ayoyi. Yanzu idan kuna neman buɗe ɓoyayyun abubuwan da ke faruwa, sake dawo da abun ciki, ko samun zurfin fahimta, ikon cire rubutu daga PowerPoint fasaha ce mai ban mamaki. Duk da haka, cire rubutun daga waɗannan gabatarwar na iya zama aiki mai wuyar gaske, musamman lokacin da ake hulɗa da manyan fayiloli ko hadaddun fayiloli. Wannan labarin yana buɗewa mai ƙarfi bayani don cire rubutu daga PowerPoint, da kuma bayyana sabbin damar Aspose.Slides Cloud SDK don NET.

API ɗin REST don Cire Rubutun PowerPoint

Idan ya zo ga ciro rubutu daga gabatarwar PowerPoint, to Aspose.Slides Cloud SDK for .NET ya fito fili a matsayin kayan aiki mai ƙarfi da dacewa. Tare da wadataccen tsarin sa na fasali da cikakken API, wannan SDK yana ƙarfafa masu haɓakawa don fitar da rubutu ba tare da wahala ba daga gabatarwa tare da daidaito da inganci.

Mataki na farko shine shigar da SDK. Don haka muna buƙatar fara bincika ‘Aspose.Slides-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Idan baku da asusun data kasance akan cloud dashboard, kawai ƙirƙirar asusun kyauta ta bin umarnin da aka ƙayyade akan farawa da sauri .Cloud/Slides/ Quickstart/).

Cire Rubutu Daga PowerPoint ta amfani da C# .NET

Bari mu bincika cikakkun bayanai kan yadda za mu iya fitar da rubutu da kyau daga cikakkiyar PowerPoint ta amfani da snippet code C# .

// 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";

// Kira API don cire duk rubutu daga gabatarwar PowerPoint
var textItems = slidesApi.GetPresentationTextItems(sourcePPTX, true, null);

// Ƙirƙiri wani abu na StreamWriter domin mu iya adana abubuwan da aka ciro
StreamWriter sw = new StreamWriter("Test.txt");

// Yi maimaita ta kowane yanayi na rubutun da aka ciro
foreach (var textItem in textItems.Items)
{
    // rubuta kowane faruwar rubutu zuwa fayil ɗin rubutu akan tsarin
    sw.WriteLine(textItem.Text);
}
// rufe StreamWriter 
sw.Close();

Yanzu bari mu haɓaka fahimtarmu game da snippet code da aka faɗi a sama.

SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);

Ƙirƙiri wani abu na ajin SlidesApi inda muka wuce bayanan abokin ciniki azaman muhawara.

var textItems = slidesApi.GetPresentationTextItems(sourcePPTX, true, null);

Kira API don cire duk abun ciki na rubutu daga gabatarwar PowerPoint da ke cikin ma’ajiyar gajimare.

StreamWriter sw = new StreamWriter("Test.txt");

Ƙirƙiri StreamWriter wanda zai taimaka mana wajen adana abubuwan da aka fitar akan tuƙi na gida.

foreach (var textItem in textItems.Items)
{
    sw.WriteLine(textItem.Text);
}
sw.Close();

Yi maimaita kowane abin da ya faru na rubutun da aka ciro kuma ajiye abin da aka fitar a cikin fayil ɗin rubutu.

Cire rubutu daga PowerPoint

Samfurin cire rubutun PowerPoint.

Kuna iya yin la’akari da zazzage samfurin PowerPoint da aka yi amfani da shi a cikin misalin da ke sama daga Bookmarks.pptx .

Cire Rubutu Daga Slide na Musamman ta amfani da Umarnin CURL

Wani madadin cire rubutu daga nunin faifan PowerPoint shine ta amfani da umarnin CURL. Tare da cURL, zaku iya hulɗa tare da Aspose.Slides Cloud API kai tsaye ta hanyar buƙatun HTTP, yana mai da shi zaɓi mai sassauƙa da samun dama ga damar cire rubutu. Don haka, ta hanyar gina ƙarshen ƙarshen API ɗin da ya dace da ƙayyadaddun sigogin da ake so, zaku iya aika umarnin cURL don dawo da rubutu daga takamaiman nunin faifai ko gabaɗayan gabatarwa.

Mataki na farko na wannan hanyar shine samar da alamar shiga 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 cire rubutu daga zane na biyu na gabatarwar PowerPoint.

curl -v "https://api.aspose.cloud/v3.0/slides/{sourceFile}/slides/2/textItems?withEmpty=false" \
-X GET \
-H  "accept: application/json" \
-H  "authorization: Bearer {accessToken}" \
-o "Extracted.txt"

Sauya ‘sourceFile’ tare da sunan shigarwar PowerPoint da ke samuwa a cikin ma’ajiyar gajimare, da ‘accessToken’ tare da alamar samun damar JWT da aka samar a sama.

Kammalawa

A ƙarshe, mun koyi cewa ikon cire rubutu daga nunin faifan PowerPoint wani abu ne mai mahimmanci wanda ke ba mu damar samun dama da amfani da abun ciki na rubutu a cikin gabatarwa don dalilai daban-daban. Ko don nazarin bayanai, tantance abun ciki, ko kowane aikace-aikace, cire rubutu daga nunin faifan PowerPoint yana ba mu ikon buɗe bayanan da ke cikin waɗannan fayilolin. Ta hanyar yin amfani da Aspose.Slides Cloud SDK don NET, za mu iya yin ayyukan cire rubutu cikin sauƙi da inganci a cikin aikace-aikacen NET ko kuma, yin amfani da umarnin cURL yana samar da dandamali mai zaman kansa kuma mai dacewa.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: