Extract Pages from PDF in C++
Contents
[
Hide
]
Use PdfFileEditor for this task. The examples below retain the original C++ code and API Reference steps.
Extract pages from PDF
Extract pages in the order 1, 4, 3.
- Create PdfFileEditor.
- Extract the selected pages with PdfFileEditor::Extract().
#include <Aspose.PDF.Cpp/Facades/PdfFileEditor.h>
#include <system/array.h>
#include <system/string.h>
namespace Facades::Examples::PDF_FileEditor
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;
void ExtractPagesFromPdf(String inputFile, String outputFile)
{
auto pdfEditor = MakeObject<PdfFileEditor>();
pdfEditor->Extract(inputFile, MakeArray<int32_t>({1, 4, 3}), outputFile);
}
} // namespace Facades::Examples::PDF_FileEditor