在C++中将PPT转换为Word

强大的跨平台 C++ API,无需 Microsoft PowerPoint 或 Office 即可使用 C++ 代码将 PowerPoint 转换为 Word

使用 Aspose.Slides 和 Aspose.Words 将 PowerPoint 转换为 Word

Aspose.Slides for C++ 和 [Aspose.Words for C++]( https://products.aspose.com/ words/cpp/) 是功能强大的 C++ 库,用于操作和转换 PowerPoint 演示文稿、Word 文档和其他文件。将 PowerPoint 转换为 Word 时,实际上是将演示文稿幻灯片的内容移动到 Word 文档中的页面。

在 C++ 中将 PowerPoint 转换为 Word

几行代码即可快速将PPT转Word

将 PowerPoint 转换为 Word 的 C++ 代码

auto presentation = MakeObject<Presentation>();
auto doc = MakeObject<Aspose::Words::Document>();
auto builder = MakeObject<Aspose::Words::DocumentBuilder>(doc);

for (const auto& slide : presentation->get_Slides())
{
    // generates and inserts slide image
    auto bitmap = slide->GetThumbnail(1.0f, 1.0f);
    builder->InsertImage(bitmap);

    // inserts slide's texts
    for (const auto& shape : slide->get_Shapes())
    {
        if (ObjectExt::Is<AutoShape>(shape))
        {
            auto autoShape = System::AsCast<AutoShape>(shape);
            builder->Writeln(autoShape->get_TextFrame()->get_Text());
        }
    }

    builder->InsertBreak(Aspose::Words::BreakType::PageBreak);
}

如何将 PPT 转换为 Word

  1. 安装 Aspose.Slides for C++Aspose.Words for C++

  2. 创建 Presentation 类和 Doc 类的实例。

  3. 加载要转换为 Word 的 PPT 演示文稿。

  4. 根据幻灯片的内容生成图像和文本。

  5. 保存生成的 Word 文档。

免费在线转换器

如何在 Python 中将 PPT 转换为 HTML

其他支持的转换

您还可以将 PowerPoint 转换为其他格式的文件