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

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



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

 Để hợp nhất tệp ODP, chúng tôi sẽ sử dụng
 [Aspose.Slides dành cho C ++](https://products.aspose.com/slides/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 các tệp ODP 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/cpp/) có thể được thực hiện chỉ với vài dòng mã.

Tải cả hai tệp ODP.

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

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

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

```

## 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 ODP extension represent presentation file format used by OpenOffice.org in the OASISOpen standard. 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. ODP files can be opened by applications that conform to the OpenDocument format (such as OpenOffice or StarOffice).

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

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