Presentation

Presentation — Aspose.Slides FOSS for C++ API Reference

Enumerations Presentation class là đối tượng gốc để tạo, tải và lưu PowerPoint .pptx các tệp trong Aspose.Slides FOSS cho C++.

Enumerations: Aspose::Slides::Foss

#include <Aspose/Slides/Foss/presentation.h>
class Presentation

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


Enumerations

EnumerationsEnumerations
Presentation()Tạo một bản trình bày mới trống với một slide trắng.
Presentation(std::string_view path)Tải một bản trình bày từ đường dẫn tệp.

Enumerations:

#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");

Truy cập Bộ sưu tập

EnumerationsKiểu trả vềEnumerations
slides()SlideCollection&Bộ sưu tập các slide có thứ tự.
layout_slides()GlobalLayoutSlideCollection&Tất cả các slide bố cục trên mọi master.
masters()MasterSlideCollection&Bộ sưu tập slide master.
images()ImageCollection&Hình ảnh được nhúng trong bản trình bày.
notes_size()NotesSize&Cài đặt kích thước trang ghi chú.
comment_authors()CommentAuthorCollection&Bộ sưu tập tác giả bình luận.
document_properties()DocumentProperties&Siêu dữ liệu tài liệu tích hợp và tùy chỉnh.

Enumerations

EnumerationsEnumerationsEnumerations
source_format()EnumerationsĐịnh dạng của nguồn bản trình bày đã tải.
first_slide_number()EnumerationsSố slide đầu tiên trong bản trình bày.
set_first_slide_number(int)EnumerationsĐặt số slide đầu tiên.
current_date_time()EnumerationsNgày và giờ được sử dụng cho các placeholder ngày‑giờ.
set_current_date_time(...)EnumerationsĐặt ngày‑giờ hiện tại cho các trình giữ chỗ.

Enumerations

save(std::string_view path, SaveFormat format)

Lưu bản trình chiếu vào một tệp.

EnumerationsEnumerationsEnumerations
pathstd::string_viewĐường dẫn tệp đích.
formatSaveFormatĐịnh dạng đầu ra (ví dụ,., SaveFormat::PPTX).
prs.save("output.pptx", SaveFormat::PPTX);

dispose()

Giải phóng các tài nguyên được bản trình chiếu giữ.

detect_source_format(std::string_view path)

Phát hiện định dạng nguồn của tệp bản trình chiếu mà không cần tải đầy đủ.


Ví dụ sử dụng

Tạo một Presentation với Shape

#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);

Mở và Kiểm tra

#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);

Xem Thêm

 Tiếng Việt