Need to extract images from PowerPoint presentations for data analysis, archiving, or automation? The GroupDocs.Parser Cloud SDK for Node.js enables developers to quickly extract embedded images from .ppt and .pptx files using simple REST API calls. No Office installation or complex parsing logic required.
ทำไมต้องดึงรูปภาพจาก PowerPoint?
- แยกเนื้อหาภาพ (โลโก้, ไอคอน, แผนภูมิ, รูปถ่าย).
- เก็บงานนำเสนอเป็นสินทรัพย์ที่มีโครงสร้าง.
- เปิดใช้งานการทำดัชนีเนื้อหาหรือเวิร์กโฟลว์คอมพิวเตอร์วิทัศน์.
- ทำการดึงสื่ออัตโนมัติจากสไลด์จำนวนมาก.
ในบทความนี้ เราจะครอบคลุมหัวข้อต่อไปนี้:
- API การสกัดภาพจาก PowerPoint
- วิธีสกัดภาพจาก PowerPoint ด้วย Node.js
- สกัดภาพจาก PowerPoint ผ่าน cURL
- เครื่องมือสกัดภาพออนไลน์
API การสกัดภาพ PowerPoint
GroupDocs.Parser Cloud SDK for Node.js ทำให้การทำงานกับไฟล์งานนำเสนอเป็นเรื่องง่าย มันช่วยให้คุณสามารถ:
- ดึงภาพจากสไลด์เฉพาะหรือทั้งหมด.
- ดึงข้อมูลโครงสร้างเช่นเมตาดาต้าของสไลด์หรือเค้าโครง.
- ทำงานกับรูปแบบอื่น ๆ (Word, Excel, PDF, ZIP, เป็นต้น).
ข้อกำหนดเบื้องต้น
- ลงทะเบียนที่ GroupDocs Cloud Dashboard.
- รับ Client ID และ Client Secret ของคุณ.
- ติดตั้ง SDK:
npm install groupdocs-parser-cloud
- สำหรับข้อมูลเพิ่มเติมเกี่ยวกับข้อมูลประจำตัวของลูกค้า โปรดเยี่ยมชม article นี้.
วิธีดึงรูปภาพจาก PowerPoint ด้วย Node.js
ทำตามขั้นตอนต่อไปนี้เพื่อพัฒนา ตัวดึงรูปภาพจาก PowerPoint ของคุณเองโดยใช้ Node.js API:
ขั้นตอนที่ 1: เริ่มต้นการกำหนดค่า.
const { ParserApi, Configuration, ImagesRequest, FileInfo, ImagesOptions } = require("groupdocs-parser-cloud");
const config = new Configuration("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
const parserApi = new ParserApi(config);
Step 2: ตั้งค่าไฟล์ข้อมูลและตัวเลือกภาพ.
Initialize an object of the ImagesRequest class and pass the instance of the ImagesOptions class.
const fileInfo = new FileInfo();
// path to your PowerPoint file
fileInfo.filePath = "sample.pdf";
const options = new ImagesOptions();
options.fileInfo = fileInfo;
const request = new ImagesRequest(options);
ขั้นตอนที่ 3: ดึงรูปภาพจาก PowerPoint.
เรียกใช้เมธอด images เพื่อดึงรูปภาพจากงานนำเสนอ PowerPoint.
parserApi.images(request).then((response) => {
console.log("Images extracted successfully.");
console.log(response.images);
}).catch((err) => {
console.error("Failed to extract images:", err);
});
ดึงภาพจาก PowerPoint ผ่าน cURL
คุณยังสามารถดึงภาพได้โดยใช้ GroupDocs.Parser REST API และ cURL.
ขั้นตอนที่ 1 – สร้าง Access Token:
curl -X POST "https://api.groupdocs.cloud/connect/token" \
-d "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET" \
-H "Content-Type: application/x-www-form-urlencoded"
ขั้นตอนที่ 2 – ดึงรูปภาพผ่าน REST API:
curl -v -X POST "https://api.groupdocs.cloud/v1.0/parser/images" \
-H "accept: application/json" \
-H "authorization: Bearer {ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d "{ \"FileInfo\": { \"FilePath\": \"input.pptx\", \"StorageName\": \"internal\" }, \"OutputPath\": \"internal\", \"StartPageNumber\": 1, \"CountPagesToExtract\": 2}"
- แทนที่ <ACCESS_TOKEN> ด้วยค่าที่คุณสร้างขึ้น
✅ ประโยชน์ของการใช้ cURL
- เหมาะสำหรับสภาพแวดล้อมแบบ headless.
- สามารถสคริปต์ได้สำหรับ pipeline CI/CD.
- ไม่ต้องติดตั้ง SDK.
- ไม่ขึ้นกับแพลตฟอร์ม (Linux/macOS/Windows).
Free PowerPoint Image Extractor
ไม่อยากเขียนโค้ด? ลองใช้ PowerPoint Image Extractor ออนไลน์ฟรีที่ขับเคลื่อนโดย GroupDocs.Parser Cloud.

สรุป
ด้วย GroupDocs.Parser Cloud SDK for Node.js การดึงรูปภาพจากไฟล์ PowerPoint จะทำได้อย่างรวดเร็วและขยายได้ ไม่ว่าคุณจะทำงานกับคลังข้อมูลการนำเสนอ, ระบบประมวลผล AI, หรือการรวม CMS — REST API นี้ให้คุณควบคุมการดึงเนื้อหาภาพได้อย่างเต็มที่
📚 แหล่งข้อมูลเพิ่มเติม
คำถามที่พบบ่อย – FAQs
ฉันสามารถดึงรูปภาพจากสไลด์เฉพาะได้หรือไม่?
- ใช่ คุณสามารถกำหนด StartPageNumber และ CountPagesToExtract เพื่อควบคุมอย่างแม่นยำ
ภาพถูกส่งคืนในความละเอียดดั้งเดิมหรือไม่?
- ใช่, API ให้ภาพคุณภาพต้นฉบับที่ฝังอยู่ในงานนำเสนอ.
PowerPoint จำเป็นต้องใช้เพื่อรันนี้หรือไม่?
- ไม่. ทุกอย่างทำงานบนคลาวด์โดยไม่ต้องใช้ MS Office.
มีการทดลองใช้ฟรีหรือไม่?
- ใช่. บัญชีใหม่จะได้รับ 150 การเรียก API ฟรีต่อเดือน. สำหรับข้อมูลเพิ่มเติม โปรดเยี่ยมชม คู่มือการกำหนดราคา
