Foxit PDF SDK

Class Methods | List of all members
FSTableGenerator Class Reference
Inheritance diagram for FSTableGenerator:

## Class Methods
(BOOL) | + addTableToPage:data:cell_array:
| Add a new table to the PDF page. More...
(BOOL) | + insertTablePagesToDocument:dest_page_index:page_width:page_height:data:cell_array:allow_to_cross_page:tablegenerator_callback:
| Insert a new table which is contained in one or multi pages into the document. 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 FSLibrary::initialize:key: with a key including "TableMaker" module.

See also
  FSLibrary

## Method Documentation

## ◆ addTableToPage:data:cell_array:()

+ (BOOL) addTableToPage: |  | (FSPDFPage*) | page
data: |  | (FSTableData*) | data
cell_array: |  | (FSTableCellDataArray*) | cell_array

Add a new table to the PDF page.

Parameters

  [in] | page | A valid PDF page object.
  [in] | data | The object of FSTableData . Please make sure that the product of FSTableData::row_count and FSTableData::col_count in data is the same as the number of cell_array, otherwise an exception will be thrown. Please make sure that the FSTableData::rect in data is not empty and is in the page box of the current page, otherwise an exception will be thrown.
  [in] | cell_array | This is a two-dimensional array, an array of FSTableCellDataColArray objects. Exception FSErrUnsupported will be thrown if the text and image are in the same cell.

Returns
  YES means success, while NO means failure.

## ◆ insertTablePagesToDocument:dest_page_index:page_width:page_height:data:cell_array:allow_to_cross_page:tablegenerator_callback:()

+ (BOOL) insertTablePagesToDocument: |  | (FSPDFDoc*) | doc
dest_page_index: |  | (int) | dest_page_index
page_width: |  | (float) | page_width
page_height: |  | (float) | page_height
data: |  | (FSTableData*) | data
cell_array: |  | (FSTableCellDataArray*) | cell_array
allow_to_cross_page: |  | (BOOL) | allow_to_cross_page
tablegenerator_callback: |  | (id<FSTableGeneratorCallback>) | tablegenerator_callback

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

Parameters

  [in] | doc | A valid PDF document object.
  [in] | dest_page_index | A 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_width | The new pages width (unit is 1/72 inch).
  [in] | page_height | The new pages height (unit is 1/72 inch).
  [in] | data | The object of FSTableData . Please make sure that the product of FSTableData::row_count and FSTableData::col_count in data is the same as the number of cell_array, otherwise an exception will be thrown. Please make sure that the FSTableData::rect in data is not empty and is in the page box of the current page, otherwise an exception will be thrown.
  [in] | cell_array | This is a two-dimensional array, an array of FSTableCellDataColArray objects. Exception FSErrUnsupported will be thrown if the text and image are in the same cell.
  [in] | allow_to_cross_page | A boolean value spacifies that whether to allow the table to cross page.YES means allow, NO means not. Currently, cell merging is not supported if parameter allow_to_cross_page is YES.
  [in] | tablegenerator_callback | The callback for table generator, which is implemented based on callback class FSTableGeneratorCallback.

Returns
  YES means success, while NO means failure.