• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2024 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef CORE_FPDFAPI_EDIT_CPDF_PAGEEXPORTER_H_
8 #define CORE_FPDFAPI_EDIT_CPDF_PAGEEXPORTER_H_
9 
10 #include <stdint.h>
11 
12 #include "core/fpdfapi/edit/cpdf_pageorganizer.h"
13 #include "core/fxcrt/span.h"
14 
15 class CPDF_Document;
16 
17 // Copies pages from a source document into a destination document.
18 // This class is intended to be used once via ExportPages() and then destroyed.
19 class CPDF_PageExporter final : public CPDF_PageOrganizer {
20  public:
21   CPDF_PageExporter(CPDF_Document* dest_doc, CPDF_Document* src_doc);
22   ~CPDF_PageExporter();
23 
24   // For the pages from the source document with `page_indices` as their page
25   // indices, insert them into the destination document at page `index`.
26   // `page_indices` and `index` are 0-based.
27   bool ExportPages(pdfium::span<const uint32_t> page_indices, int index);
28 };
29 
30 #endif  // CORE_FPDFAPI_EDIT_CPDF_PAGEEXPORTER_H_
31