Canza [HTML] (https://docs.fileformat.com/web/html/) zuwa [PowerPoint] (https://docs.fileformat.com/presentation/pptx/) na iya zama mai canza wasa ga kasuwancin da ke da ƙarfi. dogara ga gabatarwa don nuna aikinsu. A cikin duniyar yau mai saurin tafiya, yana da mahimmanci a sami hanya mai sauƙi da inganci don ƙirƙirar gabatarwar masu kyan gani. Ta hanyar canza HTML zuwa PowerPoint, kasuwanci na iya adana lokaci da ƙoƙari yayin da suke samar da gabatarwa mai inganci. Wannan tsarin jujjuyawar yana tabbatar da cewa gabatarwa sun kasance iri ɗaya da daidaito, yana bawa ‘yan kasuwa damar kula da ainihin alamar su. Tare da yin amfani da NET Cloud SDK, canza HTML zuwa PowerPoint za a iya samu cikin sauri da sauƙi.
- NET Cloud SDK don HTML zuwa Canjin PowerPoint
- Haɗa HTML a cikin PowerPoint ta amfani da C#
- Maida HTML zuwa PPT ta amfani da Umarnin CURL
NET Cloud SDK don HTML zuwa Canjin PowerPoint
Aspose.Slides Cloud SDK for .NET yana ba da hanya mai sauƙi da inganci don sauya fayilolin HTML zuwa gabatarwar PowerPoint. Tare da wannan API mai ƙarfi, zaku iya ƙirƙirar gabatarwar PowerPoint masu inganci daga fayilolin HTML, adana tsari, shimfidawa, da sauran abubuwan ƙira. Bugu da ƙari, yana kuma ba da zaɓuɓɓukan gyare-gyare na ci gaba kamar saita girman nunin faifai, zabar shimfidar faifai, da ƙara rayarwa da tasiri. Wannan ya sa ya zama kyakkyawan bayani ga ‘yan kasuwa da daidaikun mutane masu neman kayan aikin sarrafa PowerPoint.
Yanzu, da farko muna buƙatar bincika ‘Aspose.Slides-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin Ƙara Kunshin. Bugu da ƙari, yi rijistar asusu akan dashboard ɗin Cloud kuma sami takaddun shaidar abokin ciniki na keɓaɓɓen ku. Don ƙarin cikakkun bayanai, da fatan za a ziyarci jagorar farawa da sauri.
Haɗa HTML a cikin PowerPoint ta amfani da C#
A cikin wannan sashe, za mu duba snippet code wanda zai iya taimaka mana mu sanya HTML a cikin gabatarwar PowerPoint, ko kuma mu ce, yana ba mu damar canza HTML zuwa PowerPoint, ba tare da aibu ba. Kuna iya lura cewa tare da sauƙi layukan lamba uku, zamu iya canza HTML zuwa tsarin PPTX.
// 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 abun ciki na shigar da HTML cikin abun kirtani
string html = File.ReadAllText("input-sample.html");
// canza HTML zuwa PPTX akan layi
var responseStream = slidesApi.ImportFromHtml("transformed.pptx", html);
An ba da cikakkun bayanai game da snippet code na sama.
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
Ƙirƙiri misali na ajin SlidesApi inda muka wuce bayanan abokin ciniki azaman hujja ga mai ginin sa.
string html = File.ReadAllText("input-sample.html");
Karanta abun cikin fayil ɗin HTML cikin misali ‘string’.
var responseStream = slidesApi.ImportFromHtml("transformed.pptx", html);
Kira API don saka HTML cikin PowerPoint. Bayan nasarar yin nasara, ana adana sakamakon PPTX a cikin ma’ajin gajimare.
Za a iya sauke samfurin fayilolin da aka yi amfani da su a cikin misalin da ke sama daga:
- input-sample.html
- [canzawa.pptx] (hotuna / canzawa.pptx)
Maida HTML zuwa PPT ta amfani da Umarnin CURL
Juya HTML zuwa PowerPoint kuma yana yiwuwa ta amfani da umarnin cURL, yana mai da shi zaɓi mai dacewa da inganci ga kasuwanci da daidaikun mutane waɗanda ke son daidaita wannan tsari. Tare da umarnin cURL, zaku iya sauya fayilolin HTML cikin sauƙi zuwa gabatarwar PowerPoint ba tare da ƙirƙirar nunin faifai da hannu ba. Wannan hanya za ta iya ceton ku lokaci da ƙoƙari, musamman idan kuna buƙatar canza babban fayil ɗin. Bugu da ƙari, umarnin cURL sun kasance masu zaman kansu na dandamali, ma’ana za ku iya amfani da su akan kowane tsarin aiki da ke goyan bayan cURL.
Don haka, fara 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"
Na biyu, da fatan za a aiwatar da umarni mai zuwa don shigar da HTML a cikin PowerPoint kuma adana abin fitarwa zuwa ma’ajiyar girgije.
curl -v "https://api.aspose.cloud/v3.0/slides/{resultantPresentation}/fromHtml" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "<Html> <Head> <title> Example of Paragraph tag </title> </Head> <Body><h1> Main Heading... </h1> </br> <p> <!-- It is a Paragraph tag for creating the paragraph --> <b> HTML </b> stands for <i> <u> Hyper Text Markup Language. </u> </i> It is used to create a web pages and applications. This language is easily understandable by the user and also be modifiable. It is actually a Markup language, hence it provides a flexible way for designing the web pages along with the text. </Body> </Html>"
Sauya {accessToken}
tare da alamar samun damar JWT da {resultantPresentation}
da sunan sakamakon PowerPoint da za a adana a ma’ajiyar gajimare.
Kammalawa
A ƙarshe, sauya HTML zuwa PowerPoint ta amfani da Aspose.Slides Cloud SDK don NET ko umarnin cURL yana ba da hanya mai dacewa da inganci don ƙirƙirar gabatarwa mai inganci daga abubuwan da ke tushen yanar gizo. SDK yana ba da fa’idodi da yawa na fasali da zaɓuɓɓuka don gyare-gyare, yayin da umarnin cURL ke ba da hanya mai sauƙi kuma mai dacewa don aiwatar da juyawa. Tare da ikon canza HTML zuwa PowerPoint ba tare da matsala ba, za ku iya adana lokaci da ƙoƙari yayin samar da gabatarwa mai ban sha’awa na gani waɗanda ke isar da saƙon su yadda ya kamata.
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: