Split PDF from Beginning in C++

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

Split PDF from beginning

Write the first three pages to a new PDF.

  1. Create PdfFileEditor.
  2. Write the first page range with PdfFileEditor::SplitFromFirst().
#include <Aspose.PDF.Cpp/Facades/PdfFileEditor.h>
#include <system/string.h>

namespace  Facades::Examples::PDF_FileEditor
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;

void SplitPdfFromBeginning(String inputFile, String outputFile)
{
    auto pdfFileEditor = MakeObject<PdfFileEditor>();
    pdfFileEditor->SplitFromFirst(inputFile, 3, outputFile);
}
} // namespace  Facades::Examples::PDF_FileEditor