Ing donya sing cepet-cepet saiki, konten digital wis dadi pokok komunikasi. Presentasi PowerPoint (PPTX) wis dadi alat penting kanggo bisnis lan individu kanggo ngirim informasi kanthi efektif. Digunakake sacara wiyar ing lingkungan bisnis lan pendhidhikan saiki, dadi penting kanggo bisa nuduhake lan nyebarake kanthi efektif. Asring, sampeyan kudu ngowahi slide PowerPoint menyang format gambar kayata JPEG, utamane nalika nuduhake slide karo wong liya sing ora duwe akses menyang PowerPoint. Dadi ing artikel iki, kita bakal ngrembug kabeh rincian sing dibutuhake kanggo nggunakake .NET Cloud SDK kanggo ngowahi slide PowerPoint dadi gambar online.
- API Konversi PowerPoint menyang JPG
- Ngonversi PPT menyang JPG nggunakake C#
- PPTX menyang JPG nggunakake Perintah cURL
API Konversi PowerPoint menyang JPG
Nggunakake Aspose.Slides Cloud SDK kanggo .NET, konversi slide PowerPoint menyang gambar JPG minangka proses sing gampang. Aspose.Slides Cloud nyedhiyakake API RESTful sing bisa gampang diintegrasi karo aplikasi .NET kanggo ngowahi slide PowerPoint dadi gambar JPG tanpa mbutuhake piranti lunak utawa plugin tambahan.
Ngonversi slide individu utawa kabeh presentasi menyang gambar JPG.
Mangga telusuri Aspose.Slides-Cloud
ing manajer paket NuGet banjur klik tombol Tambah Paket. Salajengipun, ndhaptar akun liwat Dashboard Cloud lan entuk kredensial klien pribadhi. Kanggo informasi luwih lengkap, bukak bagean wiwit cepet.
Ngonversi PPT menyang JPG nggunakake C#
Cuplikan kode ing ngisor iki digunakake kanggo ngowahi slide PowerPoint menyang format JPG.
// Kanggo conto liyane, bukak https://github.com/aspose-slides-cloud
// Entuk kredensial klien saka https://dashboard.aspose.cloud/
string clientSecret = "7f098199230fc5f2175d494d48f2077c";
string clientID = "ee170169-ca49-49a4-87b7-0e2ff815ea6e";
// nggawe conto SlidesApi
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
// Maca presentasi PowerPoint input saka drive lokal
using var slideStream = File.OpenRead("Colorful conference presentation.pptx");
slidesApi.UploadFile("Colorful conference presentation.pptx", slideStream);
// nelpon API kanggo ngowahi kabeh slide PowerPoint menyang format JPG
using var responseStream = slidesApi.DownloadPresentation("Colorful conference presentation.pptx", ExportFormat.Jpeg, null, null);
// Simpen gambar JPG asil menyang drive lokal
using var pdfStream = File.Create("output.zip");
responseStream.CopyTo(pdfStream);
Ing ngisor iki ana rincian babagan potongan kode sing dituduhake ing ndhuwur.
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
Nggawe conto kelas SlidesApi sing njupuk kredensial klien minangka argumen ing konstruktor.
using var slideStream = File.OpenRead("Colorful conference presentation.pptx");
slidesApi.UploadFile("Colorful conference presentation.pptx", slideStream);
Muat presentasi PowerPoint input lan upload menyang panyimpenan maya.
using var responseStream = slidesApi.DownloadPresentation("Colorful conference presentation.pptx", ExportFormat.Jpeg, null, null);
Telpon API kanggo nerjemahake kabeh slide presentasi PowerPoint menyang gambar JPG. Output bali minangka conto stream.
using var pdfStream = File.Create("output.zip");
responseStream.CopyTo(pdfStream);
Simpen output minangka arsip zip ing drive lokal.
Saliyane ngowahi format PPTX lengkap dadi JPG, sampeyan uga entuk kemampuan kanggo ngowahi slide sing dipilih. Baris kode ing ngisor iki nuduhake carane sampeyan mung bisa ngowahi, 1st, 3rd lan 5th slide menyang JPG.
using var responseStream = slidesApi.DownloadPresentation("Colorful conference presentation.pptx", ExportFormat.Jpeg, null, null,null,null,null,new List<int> { 1, 3, 5 });
Presentasi sampel sing digunakake ing conto ing ndhuwur bisa diundhuh saka Konferensi Warna-warni .
PPTX menyang JPG nggunakake CURL Commands
Cara liya kanggo ngowahi slide PowerPoint dadi gambar yaiku kanthi nelpon Aspose.Slides Cloud API nggunakake perintah cURL. Kanthi cURL, sampeyan bisa ngirim panjalukan HTTP langsung saka baris perintah, dadi cara sing gampang lan trep. Saiki, pisanan kita kudu ngasilake token otentikasi kanthi ngirim panjalukan menyang titik pungkasan token nganggo App SID lan App Key.
Mangga nglakokake printah ing ngisor iki kanggo ngasilake accessToken.
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"
Sawise accessToken digawe, tindakake printah ing ngisor iki kanggo ngowahi nomer slide 4 lan 8 saka PowerPoint menyang format JPG.
curl -v "https://api.aspose.cloud/v3.0/slides/{sourceFile}/Jpeg?slides=4%2C8" \
-X POST \
-H "accept: multipart/form-data" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "{ \"DefaultRegularFont\": \"string\", \"FontFallbackRules\": [ { \"RangeStartIndex\": 0, \"RangeEndIndex\": 0, \"FallbackFontList\": [ \"string\" ] } ], \"FontSubstRules\": [ { \"SourceFont\": \"string\", \"TargetFont\": \"string\", \"NotFoundOnly\": true } ]}" \
-o "{resultantZIP}"
Ganti
{sourceFile}
nganggo jeneng presentasi PowerPoint input ing panyimpenan Cloud,{accessToken}
nganggo token akses JWT sing digawe ing ndhuwur lan,{resultantZIP}
kanthi jeneng file asil sing bakal digawe ing lokasi drive sing ditemtokake.
Kesimpulan
Kesimpulane, ngowahi slide PowerPoint dadi gambar JPG minangka fitur migunani sing bisa digunakake ing macem-macem aplikasi. Apa sampeyan pengin nggawe presentasi kanggo rapat utawa ngowahi slide kanggo enggo bareng online, Aspose.Slides Cloud SDK kanggo .NET nyedhiyakake cara sing gampang lan dipercaya kanggo ngowahi file PowerPoint menyang format JPG. Lan kanthi bantuan perintah cURL, sampeyan bisa kanthi gampang nggabungake fungsi iki menyang alur kerja sampeyan. Dadi, mung sawetara langkah sing gampang, sampeyan bisa ngowahi slide dadi gambar JPG sing berkualitas, siap digunakake kanthi cara apa wae sing dibutuhake.
Pranala Migunani
Artikel sing gegandhengan
Disaranake kanggo ngunjungi blog ing ngisor iki: