Presentation — Aspose.Slides FOSS for C++ API Reference
Properties Presentation คลาสเป็นอ็อบเจ็กต์รากสำหรับการสร้าง, โหลด, และบันทึก PowerPoint .pptx ไฟล์ใน Aspose.Slides FOSS สำหรับ C++.
Properties: Aspose::Slides::Foss
#include <Aspose/Slides/Foss/presentation.h>class PresentationProperties: include/Aspose/Slides/Foss/presentation.h
Properties
| Properties | Properties |
|---|---|
Presentation() | สร้างงานนำเสนอใหม่ที่ว่างเปล่าพร้อมสไลด์เปล่า 1 สไลด์. |
Presentation(std::string_view path) | โหลดงานนำเสนอจากเส้นทางไฟล์. |
Properties:
#include <Aspose/Slides/Foss/presentation.h>
using namespace Aspose::Slides::Foss;
// Create a new empty presentation
Presentation prs;
// Open an existing PPTX file
Presentation prs2("deck.pptx");ตัวเข้าถึงคอลเลกชัน
| Properties | ประเภทค่าที่คืนกลับ | Properties |
|---|---|---|
slides() | SlideCollection& | คอลเลกชันสไลด์ที่เรียงลำดับ. |
layout_slides() | GlobalLayoutSlideCollection& | สไลด์เลเอาต์ทั้งหมดในทุกมาสเตอร์. |
masters() | MasterSlideCollection& | คอลเลกชันสไลด์มาสเตอร์. |
images() | ImageCollection& | ภาพที่ฝังอยู่ในงานนำเสนอ. |
notes_size() | NotesSize& | การตั้งค่าขนาดหน้าบันทึกย่อ. |
comment_authors() | CommentAuthorCollection& | คอลเลกชันผู้เขียนความคิดเห็น. |
document_properties() | DocumentProperties& | เมตาดาต้าเอกสารที่มีมาในตัวและที่กำหนดเอง. |
Properties
| Properties | Properties | Properties |
|---|---|---|
source_format() | Properties | รูปแบบของแหล่งที่มาของงานนำเสนอที่โหลด. |
first_slide_number() | Properties | หมายเลขสไลด์แรกในงานนำเสนอ. |
set_first_slide_number(int) | Properties | ตั้งค่าหมายเลขสไลด์แรก. |
current_date_time() | Properties | วันที่และเวลาที่ใช้สำหรับตัวแสดงตำแหน่งวันที่-เวลา. |
set_current_date_time(...) | Properties | ตั้งค่าวันที่‑เวลาในปัจจุบันสำหรับตัวแสดงตำแหน่ง. |
Properties
save(std::string_view path, SaveFormat format)
บันทึกพรีเซนเทชันลงไฟล์.
| Properties | Properties | Properties |
|---|---|---|
path | std::string_view | เส้นทางไฟล์ปลายทาง. |
format | SaveFormat | รูปแบบผลลัพธ์ (เช่น., SaveFormat::PPTX). |
prs.save("output.pptx", SaveFormat::PPTX);dispose()
ปล่อยทรัพยากรที่พรีเซนเทชันถือครอง.
detect_source_format(std::string_view path)
ตรวจจับรูปแบบต้นฉบับของไฟล์พรีเซนเทชันโดยไม่ต้องโหลดเต็ม.
ตัวอย่างการใช้งาน
สร้างพรีเซนเทชันพร้อมรูปทรง
#include <Aspose/Slides/Foss/presentation.h>
using namespace Aspose::Slides::Foss;
Presentation prs;
auto& slide = prs.slides()[0];
auto& shapes = slide.shapes();
// Add shapes and save
prs.save("hello.pptx", SaveFormat::PPTX);เปิดและตรวจสอบ
#include <Aspose/Slides/Foss/presentation.h>
using namespace Aspose::Slides::Foss;
Presentation prs("existing.pptx");
std::cout << "Slides: " << prs.slides().size() << std::endl;
prs.save("updated.pptx", SaveFormat::PPTX);