A cikin duniyar dijital ta yau na kasuwanci da fasaha, ingantaccen sadarwa shine mabuɗin nasara. Abubuwan gabatarwa na PowerPoint sun zama kayan aiki na yau da kullun don isar da ra’ayoyi, gabatar da gabatarwa, da jan hankalin masu sauraro. Koyaya, ba duk fayilolin gabatarwa ba ne aka ƙirƙira su daidai, kuma kuna iya samun kanku kuna ma’amala da ODP (Gabatarwar OpenDocument). Shahararren tsari ne don buɗaɗɗen wuraren ofis kuma yana iya haifar da ƙalubale lokacin da kuke buƙatar haɗin gwiwa tare da masu amfani da ke aiki a cikin tsarin Microsoft PowerPoint. Anan ne ake buƙatar canza fayilolin ODP zuwa tsarin da ake amfani da shi sosai PPTX (PowerPoint) tsari ya taso. A cikin wannan labarin, za mu bincika cikakkun bayanai kan yadda ake cimma shi ba tare da wahala ba ta amfani da Aspose.Slides Cloud SDK don NET.
- API ɗin REST don Canjin PowerPoint
- ODP zuwa PPTX Kan layi ta amfani da C# .NET
- Maida Fayil na ODP zuwa PPT ta amfani da Umarnin CURL
API ɗin REST don Canjin PowerPoint
Abubuwan da ake buƙata don canza ODP zuwa PPT an yi su cikin sauƙi da inganci tare da taimakon Aspose.Slides Cloud SDK don NET. Wannan SDK mai ƙarfi yana ba da cikakkiyar fasalin fasali waɗanda ke ƙarfafa masu haɓakawa don yin aiki ba tare da wata matsala ba tare da tsarin gabatarwa daban-daban na PowerPoint. Tare da wannan SDK, ba za ku iya juyar da ODP zuwa PPTX kawai ba amma kuma ku bincika fa’idodin sauran iyakoki, gami da ƙirƙira, gyaggyarawa, da sarrafa gabatarwar PowerPoint ta tsari.
Mataki na farko shine ƙarin bayani na SDK a cikin maganin NET ɗin mu. Don haka, bincika ‘Aspose.Slides-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Na biyu, ziyarci allon dashboard kuma sami keɓaɓɓen shaidar abokin ciniki.
Idan ba ku da asusun da ke akwai, kawai ƙirƙiri asusun kyauta ta bin umarnin da aka ƙayyade a cikin jagorar saurin farawa.
ODP zuwa PPTX Kan layi ta amfani da C# .NET
A cikin wannan sashe, za mu bincika cikakkun bayanai da snippet code don haɓaka ODP zuwa mai canza PPTX ta amfani da C# .NET.
// 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 PowerPoint dake kan tuƙi na gida
string sourcePPTX = "file_example_ODP_200kB.odp";
// kira API don canza ODP zuwa tsarin PPTX
var response = slidesApi.DownloadPresentation(inputFile, ExportFormat.Pptx);
// Hanyar kira don ajiye fitarwa a kan tuƙi na gida
saveToDisk(response, "/Users/nayyer/Downloads/resultantFile.pptx");
// hanya don adana abun ciki na rafi zuwa fayil akan faifan gida
public static void saveToDisk(Stream responseStream, String resultantFile)
{
var fileStream = File.Create(resultantFile);
responseStream.Seek(0, SeekOrigin.Begin);
responseStream.CopyTo(fileStream);
fileStream.Close();
}
An ba da cikakkun bayanai game da snippet code na sama.
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
Da farko, ƙirƙiri misali na ajin SlidesApi inda muke ƙaddamar da bayanan abokin ciniki azaman muhawara.
var response = slidesApi.DownloadPresentation(inputFile, ExportFormat.Pptx);
Kira API don canza fayil ɗin ODP da aka adana a ma’ajin gajimare zuwa tsarin PPTX.
saveToDisk(result, "/Users/nayyer/Downloads/htmlOutput.pdf");
A ƙarshe, muna kiran hanyar don adana sakamakon gabatarwar PowerPoint akan faifan gida.
Hanyar Zazzagewa(..) tana karɓar siga na zaɓi ‘slides’ inda zaku iya samar da fihirisar nunin faifai don adanawa. Idan ba a ƙayyade bayanai ba, to duk nunin faifai ana ajiye su ta tsohuwa.
Maida Fayil na ODP zuwa PPT ta amfani da Umarnin CURL
Mayar da ODP zuwa PPT kuma ana iya samun nasara ba tare da wata matsala ba ta amfani da umarnin cURL tare da API ɗin Aspose.Slides Cloud mai ƙarfi. Tare da wannan hanyar, zaku iya jin daɗin fa’idodin ƙarfin juzu’i na tushen girgije na Aspose ta hanyar buƙatun HTTP masu sauƙi kuma madaidaiciya. API ɗin zai aiwatar da buƙatarku a cikin gajimare, da sauri ya canza gabatarwar ODP zuwa tsarin PPT. Da zarar jujjuyawa ya cika, zaku karɓi fayil ɗin da aka canza azaman amsawa, shirye don saukewa ko ƙara sarrafa su kamar yadda ake buƙata.
Yanzu, da farko muna buƙatar aiwatar da umarni mai zuwa don samar da alamar shiga 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"
Da zarar an ƙirƙiri alamar JWT, da fatan za a aiwatar da umarni mai zuwa don canza ODP zuwa tsarin PPTX na PowerPoint:
curl -v "https://api.aspose.cloud/v3.0/slides/{inputODP}/Pptx" \
-X POST \
-H "accept: multipart/form-data" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "{ \"DefaultRegularFont\": \"arial\", \"FontFallbackRules\": [ { \"RangeStartIndex\": 0, \"RangeEndIndex\": 0, \"FallbackFontList\": [ \"string\" ] } ]}" \
-o "Converted.pptx"
Sauya ‘inputODP’ tare da sunan shigarwar ODP daftarin aiki da ake samu a cikin ma’ajiyar girgije, da ‘accessToken’ tare da alamar JWT da aka samar a sama.
Kuna iya yin la’akari da zazzage samfurin fayil ɗin ODP da aka yi amfani da shi a cikin misalin da ke sama daga [fileexampleODP200kB.odp](https://www.dropbox.com/scl/fi/kfu0u4nl7pdzdmrcmdu7u/fileexampleODP200kB.odp?rlkey=9y51clejhzqr&dp4f.
Kammalawa
A ƙarshe, ana iya samun sauƙin sauya ODP zuwa PPT ta amfani da hanyoyi biyu masu ƙarfi: Aspose.Slides Cloud SDK don NET da umarnin cURL tare da Aspose.Slides Cloud API. Duk hanyoyin biyu suna ba da fa’idodi na musamman, suna ba da fifikon abubuwan ci gaba daban-daban da mahalli. Ko wace hanya kuka zaɓa, Aspose.Slides Cloud API yana tabbatar da inganci mai inganci da ingantaccen ODP zuwa jujjuyawar PPT, yana ba ku ƙarfin sarrafa abubuwan gabatarwa na PowerPoint. Don haka, rungumi ikon NET Cloud SDK don haɓaka ayyukan sarrafa daftarin aiki da samun sakamako na ban mamaki cikin sauƙi da inganci.
Hanyoyin haɗi masu amfani
Labarai masu alaka
Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: