PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
PDF::DocumentAssembler Class Reference

Assembles PDF documents. More...

#include <pdfsdk/cxx/document_assembler.h>

Inheritance diagram for PDF::DocumentAssembler:

Public Member Functions

void AddPages (const Document &source)
 Adds a document to the DocumentAssembler object.
 
void AddPages (const Document &source, const PDPageRange &page_range)
 Takes a series of pages from a document and adds them to the DocumentAssembler object.
 
void AddPages (const Document &source, const std::vector< size_t > &page_indices)
 Takes specific pages from a document and adds them to the DocumentAssembler object.
 
void AddImage (const Graphics::Bitmap &bitmap)
 Adds an image to the DocumentAssembler object.
 
void AddImageFromFile (const std::filesystem::path &image_path)
 Adds an image located on the system to the DocumentAssembler object.
 
void AddImageFromMemory (const void *data, size_t size)
 Adds an in-memory raw data image to the DocumentAssembler object.
 
Document Assemble ()
 Assembles the document.
 
 DocumentAssembler (PDFDocumentAssembler handle, bool adopt=false) noexcept
 
 DocumentAssembler (const DocumentAssembler &rhs) noexcept
 
DocumentAssembleroperator= (const DocumentAssembler &rhs) noexcept
 
 DocumentAssembler (DocumentAssembler &&rhs) noexcept
 
DocumentAssembleroperator= (DocumentAssembler &&rhs) noexcept
 

Static Public Member Functions

static DocumentAssembler Create ()
 Creates a new DocumentAssembler object.
 

Detailed Description

Assembles PDF documents.

Use this class to assemble PDF documents from multiple sources. You can merge multiple PDF documents into one, select specific pages from an existing document to create a new document, merge multiple documents by selecting specific pages from each one - into a new document, add raster image formats to an existing document. The resulting document can be saved to a file or used for further processing.

Member Function Documentation

◆ AddImage()

void PDF::DocumentAssembler::AddImage ( const Graphics::Bitmap & bitmap)
inline

Adds an image to the DocumentAssembler object.

Add raster image formats such as .png .bmp .gif .jpg etc. Should be called again on the same DocumentAssembler object to add another image.

Parameters
[in]bitmapA reference to the bitmap object to add.
See also
Graphics::Bitmap

◆ AddImageFromFile()

void PDF::DocumentAssembler::AddImageFromFile ( const std::filesystem::path & image_path)
inline

Adds an image located on the system to the DocumentAssembler object.

Add raster image formats such as .png .bmp .gif .jpg etc. Should be called again on the same DocumentAssembler object to add another image.

Parameters
[in]image_pathA reference to the path to the image file in wide character string format including the file extention (i.e. L"path/to/file.ext").

◆ AddImageFromMemory()

void PDF::DocumentAssembler::AddImageFromMemory ( const void * data,
size_t size )
inline

Adds an in-memory raw data image to the DocumentAssembler object.

Parameters
[in]dataA pointer to the image data.
[in]sizeThe size of the image data.

◆ AddPages() [1/3]

void PDF::DocumentAssembler::AddPages ( const Document & source)
inline

Adds a document to the DocumentAssembler object.

Should be called again on the same DocumentAssembler object to add another document for merging.

Parameters
[in]sourceA reference to the already opened document to add.

◆ AddPages() [2/3]

void PDF::DocumentAssembler::AddPages ( const Document & source,
const PDPageRange & page_range )

Takes a series of pages from a document and adds them to the DocumentAssembler object.

Should be called again on the same DocumentAssembler object to add another series of pages from another document for merging.

Parameters
[in]sourceA reference to the already opened document whose range of pages to take.
[in]page_rangeThe page range to add starting from 0. Should be defined as {0, 1, 2} for pages 1, 2 and 3 of the PDF document.
See also
PDPageRange

◆ AddPages() [3/3]

void PDF::DocumentAssembler::AddPages ( const Document & source,
const std::vector< size_t > & page_indices )
inline

Takes specific pages from a document and adds them to the DocumentAssembler object.

Should be called again on the same DocumentAssembler object to add another document's selected pages.

Parameters
[in]sourceA reference to the already opened document whose specified pages to take.
[in]page_indicesThe page numbers to add starting from 0 (i.e. {0, 2, 10} are pages 1, 3 and 11 from the PDF document).
See also
std::vector<size_t>

◆ Assemble()

Document PDF::DocumentAssembler::Assemble ( )
inline

Assembles the document.

Returns
The assembled document object.

The documentation for this class was generated from the following file: