# Hợp nhất các tệp PPTX qua C ++

> Mã ví dụ C ++ để kết hợp các tài liệu PPTX trên Môi trường thời gian chạy C ++ cho Windows 32 bit, Windows 64 bit và Linux 64 bit.

Source: https://products.aspose.com/slides/vi/cpp/merger/pptx/
Updated: 2026-08-11



## Cách hợp nhất tệp PPTX bằng C ++

 Để hợp nhất tệp PPTX, chúng tôi sẽ sử dụng
 [Aspose.Slides dành cho C ++](https://products.aspose.com/slides/vi/cpp/)
 API là một API hợp nhất tài liệu giàu tính năng, mạnh mẽ và dễ sử dụng cho nền tảng C ++. Bạn có thể tải xuống phiên bản mới nhất của nó trực tiếp, chỉ cần mở
 [NuGet](https://www.nuget.org/packages/aspose.slides)
 quản lý gói, tìm kiếm
 ** Aspose.Slides.Cpp **
 và cài đặt. Bạn cũng có thể sử dụng lệnh sau từ Bảng điều khiển Trình quản lý Gói.

### Yêu cầu

```cs

PM> Install-Package Aspose.Slides.Cpp

```

## Các bước để hợp nhất tệp PPTX trong C ++

Việc hợp nhất và nối tài liệu cơ bản với API [Aspose.Slides for C ++](https://products.aspose.com/slides/vi/cpp/) có thể được thực hiện chỉ với vài dòng mã.

Tải cả hai tệp PPTX.

Sử dụng phương thức get \ _Slides () để lặp qua từng trang trình bày.

Sử dụng chức năng AddClone để hợp nhất với tệp mong muốn.

Sử dụng phương thức Save () để lưu tại đường dẫn được chỉ định

## yêu cầu hệ thống

 Aspose.Slides for C ++ hỗ trợ trên tất cả các nền tảng và Hệ điều hành chính. Vui lòng đảm bảo rằng bạn có các điều kiện tiên quyết sau.

- Microsoft Windows hoặc hệ điều hành tương thích với C ++ Runtime Environment dành cho Windows 32 bit, Windows 64 bit và Linux 64 bit.
- Aspose.Slides cho C ++ DLL được tham chiếu trong dự án của bạn.

### Hợp nhất các tệp PPTX - C ++

```cs
// The path to the documents directory.
const String sourceFilePath1 = u"SourceFile2.pptx";
const String sourceFilePath2 = u"SourceFile3.pptx";
const String outputFilePath = u"mergedOutput.pptx";

// Instantiate Presentation class
SharedPtr<Presentation> presentation1 = MakeObject<Presentation>(sourceFilePath1);
SharedPtr<Presentation> presentation2 = MakeObject<Presentation>(sourceFilePath2);

for (SharedPtr<ISlide> slide : presentation2->get_Slides()){
	// Merge from source to destination
	presentation1->get_Slides()->AddClone(slide);
}

// Save the presentation
presentation1->Save(outputFilePath, SaveFormat::Pptx);

```

## Giới thiệu về Aspose.Slides cho C ++ API

 API Aspose.Slides có thể được sử dụng để đọc, viết, thao tác và chuyển đổi tài liệu Microsoft PowerPoint sang PDF, XPS, HTML, TIFF, ODP và nhiều định dạng khác. Người ta có thể tạo các tệp mới từ đầu và lưu chúng ở các định dạng được hỗ trợ có liên quan. Aspose.Slides là một API độc lập để tạo, phân tích cú pháp hoặc thao tác với các bản trình bày, trang trình bày và các phần tử và nó không phụ thuộc vào bất kỳ phần mềm nào như Microsoft hoặc OpenOffice.

Files with PPTX extension are presentation files created with popular Microsoft PowerPoint application. Unlike the previous version of presentation file format PPT which was binary, the PPTX format is based on the Microsoft PowerPoint open XML presentation file format. A presentation file is a collection of slides where each slide can comprise of text, images, formatting, animations, and other media. These slides are presented to audience in the form of slideshows with custom presentation settings.

## Các định dạng hợp nhất được hỗ trợ khác

- [ODP](https://products.aspose.com/slides/vi/cpp/merger/odp/) — Định dạng bản trình bày OpenDocument
- [OTP](https://products.aspose.com/slides/vi/cpp/merger/otp/) — Định dạng chuẩn OpenDocument
- [POT](https://products.aspose.com/slides/vi/cpp/merger/pot/) — Tệp mẫu Microsoft PowerPoint
- [POTM](https://products.aspose.com/slides/vi/cpp/merger/potm/) — Tệp Mẫu Microsoft PowerPoint
- [POTX](https://products.aspose.com/slides/vi/cpp/merger/potx/) — Bản trình bày mẫu Microsoft PowerPoint
- [PPS](https://products.aspose.com/slides/vi/cpp/merger/pps/) — Trình chiếu PowerPoint
- [PPSM](https://products.aspose.com/slides/vi/cpp/merger/ppsm/) — Trình chiếu hỗ trợ macro
- [PPSX](https://products.aspose.com/slides/vi/cpp/merger/ppsx/) — Trình chiếu PowerPoint
- [PPT](https://products.aspose.com/slides/vi/cpp/merger/ppt/) — Microsoft PowerPoint 97-2003
- [PPTM](https://products.aspose.com/slides/vi/cpp/merger/pptm/) — Tệp trình bày hỗ trợ macro
