Haɗa PowerPoint

Haɗa gabatarwar PowerPoint | Koyi yadda ake haɗa PowerPoint akan layi

Haɓaka ƙwarewar gabatarwar ku tare da sabon jagorarmu kan haɗa PowerPoint nunin faifai ta amfani da NET REST API. A cikin yanayin yanayin gabatarwa, sau da yawa ana buƙatar haɗa nunin faifai daga tushe da yawa don labari mai haɗin kai da tasiri. Ko kuna ƙarfafa gudummawar ƙungiya ko kuma inganta ƙirƙirar abun cikin ku, ikon haɗa gabatarwar PowerPoint na iya zama mai canza wasa. Kasance tare da mu a kan tafiya don sauƙaƙe ayyukanku, haɓaka haɗin gwiwa, da cimma cikakkiyar gabatarwa ba tare da wahala ba.

API ɗin NET REST don Haɗa Gabatarwar PowerPoint

Ana iya cika aikin haɗa nunin faifan PowerPoint ba tare da matsala ba ta amfani da Aspose.Slides Cloud SDK don NET. Cloud SDK ɗin mu yana ba ku damar wuce haɗin kai mai sauƙi, yana ba da fasalulluka waɗanda ke haɓaka ƙirƙirar gabatarwa, gudanarwa, da haɗin gwiwa. Kasance tare da mu yayin da muke bincika SDK da aka tsara don haɓaka ƙwarewar ku ta PowerPoint zuwa sabon matsayi.

Ana samun SDK don saukewa akan NuGet | GitHub. Don haka, da fatan za a aiwatar da umarni mai zuwa a cikin na’ura mai sarrafa fakiti don shigar da Aspose.Slides Cloud SDK don NET.

Install-Package Aspose.Slides-Cloud

Hakazalika, domin shigar da SDK ta tashar layin umarni, da fatan za a aiwatar da umarni mai zuwa.

nuget install Aspose.Slides-Cloud

Da zarar an shigar da SDK, mataki na gaba shine ƙirƙira asusun Aspose Cloud da samun cikakkun bayanan shaidar abokin ciniki.

Shaidar Abokin Ciniki

Hoto 1:- Shaidar Abokin Ciniki akan Dashboard na Cloud.

Haɗa gabatarwar PowerPoint ta amfani da C#

Bari mu bi matakan da aka bayar a ƙasa don fara haɗawar Microsoft PowerPoint ta amfani da C# .NET.

  • Da farko, muna buƙatar ƙirƙirar wani abu na ajin Kanfigareshan.
  • Abu na biyu, saita takaddun shaidar abokin ciniki zuwa misalin ‘Configuration’.
  • Abu na uku, ƙirƙiri wani abu na SlidesApi yayin wucewa da abin daidaitawa azaman hujja.
  • Mataki na gaba shine ƙirƙirar wani abu na ‘PresentationsMergeRequest’ ajin kuma a ƙaddamar da tsararrun gabatarwar PowerPoint don haɗawa.
  • A ƙarshe, kira hanyar Haɗa(…) na ajin SlidesApi, don haɗa gabatarwar PowerPoint da ajiye fitarwa zuwa ainihin shigar da PowerPoint.
// Don cikakkun misalai da fayilolin bayanai, da fatan za a je zuwa https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet/tree/master/Examples
// Samu bayanan abokin ciniki daga https://dashboard.aspose.cloud/

// ƙirƙirar misali na Kanfigareshan
Aspose.Slides.Cloud.Sdk.Configuration configuration = new Aspose.Slides.Cloud.Sdk.Configuration();
// saita abokin ciniki takardun shaidarka 
configuration.AppSid = "bbf94a2c-6d7e-4020-b4d2-b9809741374e";
configuration.AppKey = "1c9379bb7d701c26cc87e741a29987bb";

try
{
    // gabatarwar gabatarwa babba
    string mainPresentation = "test-unprotected-old.pptx";

    // nan take SlidesAPI abu
    SlidesApi slidesApi = new SlidesApi(configuration);
    
    // ƙirƙirar wani abu na PostSlidesDocumentFromPdfRequest abu mai ɗauke da sunan fayil na sakamako
    var mergeRequest = new PresentationsMergeRequest();
    
    // ƙirƙiri jerin Abubuwan Gabatarwa na Microsoft PowerPoint don haɗawa
    mergeRequest.PresentationPaths = new List<string> { "test-unprotected.pptx", "Resultant.pptx" };

    // kiran hanyar don haɗa PowerPoint akan layi
    var response = slidesApi.Merge(mainPresentation, mergeRequest);
    
    if (response != null && response.Equals("OK"))
    {
        Console.WriteLine("PowerPoint Presentations successfully Merged !");
        Console.ReadKey();
    }

catch (Exception ex)
{
    Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}

Haɗa PPTX ta amfani da Umarnin CURL

Ana iya samun dama ga REST APIs ta umarnin cURL akan kowane dandamali. Don haka a cikin wannan sashe, za mu bincika cikakkun bayanai na yadda za mu iya haɗa PowerPoint akan layi ta amfani da umarnin cURL. Don haka, mataki na farko shine ƙirƙirar alamar samun damar JWT bisa ga shaidar abokin ciniki. Yanzu, da fatan za a aiwatar da umarni mai zuwa don samar da alamar JWT.

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bbf94a2c-6d7e-4020-b4d2-b9809741374e&client_secret=1c9379bb7d701c26cc87e741a29987bb" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Da zarar mun sami alamar shiga, da fatan za a aiwatar da umarni mai zuwa don loda gabatarwar PowerPoint daga ma’ajin gajimare kuma ku haɗa PowerPoints cikin fayil ɗin haɗin kai.

curl -X POST "https://api.aspose.cloud/v3.0/slides/test-unprotected-old.pptx/merge" \
-H  "accept: application/json" \
-H  "authorization: Bearer <JWT Token>" \
-H  "Content-Type: application/json" \
-d "{  \"PresentationPaths\": [    \"test-unprotected.pptx\",\"Resultant.pptx\"  ]}"

Kammalawa

Yayin da muke kammala tafiyar mu zuwa haɗa nunin faifan PowerPoint tare da Aspose.Slides Cloud SDK don NET, mun bincika kayan aiki iri-iri wanda ke kawo inganci da kuzari ga gabatarwarku. Daga haɗe-haɗe maras kyau zuwa abubuwan ci-gaba don haɓaka gabatarwa, Aspose.Slides Cloud yana tabbatar da zama kadara mai mahimmanci a cikin kayan aikin ku. Bugu da ƙari, ga waɗanda suka fi son mu’amalar layin umarni, mun nuna cewa samun ƙwarewar haɗin kai iri ɗaya yana yiwuwa ta amfani da umarnin cURL. Ko kun zaɓi tsarin SDK ko tsarin umarni, Aspose.Slides Cloud yana ba ku ikon sarrafa abubuwan gabatarwa na PowerPoint cikin sauƙi da daidaito.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar hanyoyin haɗin yanar gizo masu zuwa don ƙarin koyo game da: