Foxit PDF SDK
foxit::addon::tablegenerator::TableGenerator Class Reference
Inheritance diagram for foxit::addon::tablegenerator::TableGenerator:
foxit::Base

Static Public Member Functions

static bool AddTableToPage (const foxit::pdf::PDFPage &page, const TableData &data, const TableCellDataArray &cell_array)
 Add a new table to the PDF page. More...
 
static bool InsertTablePagesToDocument (const foxit::pdf::PDFDoc &doc, int dest_page_index, float page_width, float page_height, const TableData &data, const TableCellDataArray &cell_array, bool allow_to_cross_page, TableGeneratorCallback *tablegenerator_callback=0)
 Insert a new table which is contained in one or multi pages into the document. More...
 

Additional Inherited Members

- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

Detailed Description

This class is used to insert tables to PDF document. Before using any class or methods in this module, please ensure Foxit PDF SDK has been initialized successfully by function common::Library::Initialize with a key including "TableMaker" module.

See also
common::Library

Member Function Documentation

◆ AddTableToPage()

static bool foxit::addon::tablegenerator::TableGenerator::AddTableToPage ( const foxit::pdf::PDFPage page,
const TableData data,
const TableCellDataArray cell_array 
)
static

Add a new table to the PDF page.

Parameters
[in]pageA valid PDF page object.
[in]dataThe object of TableData. Please make sure that the product of TableData::row_count and TableData::col_count in data is the same as the number of cell_array, otherwise an exception will be thrown. Please make sure that the TableData::rect in data is not empty and is in the page box of the current page, otherwise an exception will be thrown.
[in]cell_arrayThis is a two-dimensional array, an array of TableCellDataColArray objects. Exception foxit::e_ErrUnsupported will be thrown if the text and image are in the same cell.
Returns
true means success, while false means failure.

◆ InsertTablePagesToDocument()

static bool foxit::addon::tablegenerator::TableGenerator::InsertTablePagesToDocument ( const foxit::pdf::PDFDoc doc,
int  dest_page_index,
float  page_width,
float  page_height,
const TableData data,
const TableCellDataArray cell_array,
bool  allow_to_cross_page,
TableGeneratorCallback tablegenerator_callback = 0 
)
static

Insert a new table which is contained in one or multi pages into the document.

Parameters
[in]docA valid PDF document object.
[in]dest_page_indexA dest page index in current PDF document. This is used to specify where the new pages will be inserted. If parameter dest_page_index is less than 0, the new pages will be inserted to the first.
If parameter dest_page_index is equal to or larger than current page count, the new pages will be inserted to the end.
[in]page_widthThe new pages width (unit is 1/72 inch).
[in]page_heightThe new pages height (unit is 1/72 inch).
[in]dataThe object of TableData. Please make sure that the product of TableData::row_count and TableData::col_count in data is the same as the number of cell_array, otherwise an exception will be thrown. Please make sure that the TableData::rect in data is not empty and is in the page box of the current page, otherwise an exception will be thrown.
[in]cell_arrayThis is a two-dimensional array, an array of TableCellDataColArray objects. Exception foxit::e_ErrUnsupported will be thrown if the text and image are in the same cell.
[in]allow_to_cross_pageA boolean value spacifies that whether to allow the table to cross page.true means allow, false means not. Currently, cell merging is not supported if parameter allow_to_cross_page is true.
[in]tablegenerator_callbackThe callback for table generator, which is implemented based on callback class addon::tablegenerator::TableGeneratorCallback.
Returns
true means success, while false means failure.