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

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



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

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

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

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

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

```

## 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 .OTP extension represent presentation template files created by applications in OASIS OpenDocument standard format. The contents of such a file include presentation information in the form of slides with text, images, shapes, multimedia content, transition effects and other slide elements. These template files are used for creating new presentations quickly based on the styling information stored in the template itself. OTP files can be created and saved with several different applications such as Impress that comes with OpenOffice suite and Microsoft PowerPoint. The OTP file format is similar to Microsoft PowerPoint template files .POT and .POTX.

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