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

> Mã ví dụ C ++ để kết hợp các tài liệu PPT 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/ppt/
Updated: 2026-08-11



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

 Để hợp nhất tệp PPT, 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 PPT 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 PPT.

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 PPT - C ++

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

// 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::Ppt);

```

## 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.

A file with PPT extension represents PowerPoint file that consists of a collection of slides for displaying as SlideShow. It specifies the Binary File Format used by Microsoft PowerPoint 97-2003. A PPT file can contain several different types of information such as text, bulleted points, images, multimedia and other embedded OLE objects. Microsoft came up with newer file format for PowerPoint, known as PPTX, from 2007 onwards that is based on Office OpenXML and is different from this binary file format. Several other application programs such as OpenOffice Impress and Apple Keynote can also create PPT files.

## 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
- [PPTM](https://products.aspose.com/slides/vi/cpp/merger/pptm/) — Tệp trình bày hỗ trợ macro
- [PPTX](https://products.aspose.com/slides/vi/cpp/merger/pptx/) — Định dạng bản trình bày XML mở
