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 PresentationEnumerations: include/Aspose/Slides/Foss/presentation.h
Enumerations
| Enumerations | Enumerations |
|---|---|
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
| Enumerations | Kiể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
| Enumerations | Enumerations | Enumerations |
|---|---|---|
source_format() | Enumerations | Định dạng của nguồn bản trình bày đã tải. |
first_slide_number() | Enumerations | Số 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() | Enumerations | Ngà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.
| Enumerations | Enumerations | Enumerations |
|---|---|---|
path | std::string_view | Đường dẫn tệp đích. |
format | SaveFormat | Đị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);