C++を介してPPTXにテキスト透かしを追加する
サーバー側APIを使用してPPTXファイルに透かしを入れる独自のC++アプリを作成します。
C++を使用してPPTXファイルに透かしを入れる方法
PPTXファイルに透かしを入れるために、 [Aspose.Slides for C ++](https://products.aspose.com/slides/ja/cpp) 機能が豊富で強力で使いやすいC++プラットフォーム用のドキュメント透かしAPIであるAPI。最新バージョンを直接ダウンロードできます。開くだけです。 [NuGet](https://www.nuget.org/packages/aspose.slides) パッケージマネージャー、検索 ** Aspose.Slides.Cpp ** とインストールします。パッケージマネージャーコンソールから次のコマンドを使用することもできます。
指示
PM> Install-Package Aspose.Slides.Cpp
C++を介してPPTXに透かしを追加する手順
自分の環境で次のワークフローを試すには、[aspose.slides.dll](https://downloads.aspose.com/slides/cpp)が必要です。
Presentationクラスのインスタンスを含むPPTXファイルをロードします
最初のスライドを取得
長方形タイプのオートシェイプを追加します
TextFrameを長方形に追加します
テキストフレームの段落オブジェクトを作成します
段落の部分オブジェクトを作成する
set \ _Text()を使用して透かしを追加します
ドキュメントを保存
システム要求
Aspose.Slides for C ++は、すべての主要なプラットフォームとオペレーティングシステムでサポートされています。次の前提条件があることを確認してください。
PPTXに透かしを追加-C++
// Load the desired PPTX File
SharedPtr<Presentation> pres = MakeObject<Presentation>(u"templatePath.pptx");
// Access first slide
SharedPtr<ISlide> slide = pres->get_Slides()->idx_get(0);
// Add an AutoShape of Rectangle type
SharedPtr<IAutoShape> ashp = slide->get_Shapes()->AddAutoShape(ShapeType::Rectangle, 150, 75, 150, 50);
ashp->get_FillFormat()->set_FillType(FillType::NoFill);
// Add TextFrame to the Rectangle
ashp->AddTextFrame(u" ");
// Accessing the text frame
SharedPtr<ITextFrame> txtFrame = ashp->get_TextFrame();
// Create the Paragraph object for text frame
SharedPtr<IParagraph> paragraph = txtFrame->get_Paragraphs()->idx_get(0);
// Create Portion object for paragraph
SharedPtr<IPortion> portion = paragraph->get_Portions()->idx_get(0);
portion->set_Text(u"Watermark Text Watermark Text Watermark Text");
//Adding another shape
SharedPtr<IAutoShape> ashape2 = slide->get_Shapes()->AddAutoShape(ShapeType::Triangle, 200, 365, 400, 150);
//Reorder shape
slide->get_Shapes()->Reorder(2, ashape2);
// Save PPTX to Disk
pres->Save(u"outPath.pptx", Aspose::Slides::Export::SaveFormat::Pptx);
Aspose.Slides for C++APIについて
Aspose.Slides APIを使用して、Microsoft PowerPointドキュメントの読み取り、書き込み、操作、およびPDF、XPS、HTML、TIFF、ODP、その他のさまざまな形式への変換を行うことができます。新しいファイルを最初から作成し、サポートされている関連する形式で保存できます。 Aspose.Slidesは、プレゼンテーション、スライド、要素を作成、解析、または操作するためのスタンドアロンAPIであり、MicrosoftやOpenOfficeなどのソフトウェアに依存しません。Watermark PPTX via Online App
Add watermark to PPTX documents by visiting our Live Demos website . The live demo has the following benefits
PPTX PPTX ファイル形式とは
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.
続きを読む