Add Movie Annotation in C++

Use PdfContentEditor for this task. The examples below retain the original C++ code and API Reference steps.

Add movie annotation

Create a movie annotation on page 1 using movieFile and the supplied display rectangle.

  1. Create PdfContentEditor.
  2. Bind the PDF input with Facade::BindPdf().
  3. Create the movie annotation with PdfContentEditor::CreateMovie().
  4. Save the resulting PDF with PdfContentEditor::Save().
#include <Aspose.PDF.Cpp/Facades/PdfContentEditor.h>
#include <drawing/rectangle.h>
#include <system/string.h>

namespace Facades::Examples::PDF_ContentEditor
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;
using Rectangle = System::Drawing::Rectangle;

void AddMovieAnnotation(String inputFile, String movieFile, String outputFile)
{
    auto editor = MakeObject<PdfContentEditor>();

    editor->BindPdf(inputFile);
    editor->CreateMovie(Rectangle(80, 500, 220, 120), movieFile, 1);
    editor->Save(outputFile);
}
} // namespace Facades::Examples::PDF_ContentEditor