Presentation

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 Presentation

Properties: include/Aspose/Slides/Foss/presentation.h


Properties

PropertiesProperties
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

PropertiesPropertiesProperties
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)

บันทึกพรีเซนเทชันลงไฟล์.

PropertiesPropertiesProperties
pathstd::string_viewเส้นทางไฟล์ปลายทาง.
formatSaveFormatรูปแบบผลลัพธ์ (เช่น., 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);

ดูเพิ่มเติม

 ภาษาไทย