Foxit PDF SDK

Public Member Functions | Static Public Member Functions | List of all members
com.foxit.sdk.addon.tablegenerator.TableGenerator Class Reference
Inheritance diagram for com.foxit.sdk.addon.tablegenerator.TableGenerator:

## Public Member Functions
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
Public Member Functions inherited from com.foxit.sdk.common.Base
synchronized void | delete ()
| Clean up related C++ resources immediately. More...

## Static Public Member Functions
static boolean | addTableToPage (PDFPage page, TableData data, TableCellDataArray cell_array) throws com.foxit.sdk.PDFException
| Add a new table to the PDF page. More...
static boolean | insertTablePagesToDocument (PDFDoc doc, int dest_page_index, float page_width, float page_height, TableData data, TableCellDataArray cell_array, boolean allow_to_cross_page, TableGeneratorCallback tablegenerator_callback) throws com.foxit.sdk.PDFException
| 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 common.Library.initialize with a key including "TableMaker" module.

See also
  com.foxit.sdk.common.Library

## Member Function Documentation

## ◆ addTableToPage()

static boolean com.foxit.sdk.addon.tablegenerator.TableGenerator.addTableToPage | ( | PDFPage | page,
|  | TableData | data,
|  | TableCellDataArray | cell_array
| ) |  | throws com.foxit.sdk.PDFException
| static

Add a new table to the PDF page.

Parameters

  [in] | page | A valid PDF page object.
  [in] | data | The object of TableData . Please make sure that the product of TableData.getRow_count and TableData.getCol_count in data is the same as the number of cell_array, otherwise an exception will be thrown. Please make sure that the TableData.getRect 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 TableCellDataColArray objects. Exception com.foxit.sdk.common.Constants.e_ErrUnsupported will be thrown if the text and image are in the same cell.

Returns
  true means success, while false means failure.

## ◆ delete()

synchronized void com.foxit.sdk.addon.tablegenerator.TableGenerator.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ insertTablePagesToDocument()

static boolean com.foxit.sdk.addon.tablegenerator.TableGenerator.insertTablePagesToDocument | ( | PDFDoc | doc,
|  | int | dest_page_index,
|  | float | page_width,
|  | float | page_height,
|  | TableData | data,
|  | TableCellDataArray | cell_array,
|  | boolean | allow_to_cross_page,
|  | TableGeneratorCallback | tablegenerator_callback
| ) |  | throws com.foxit.sdk.PDFException
| static

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 TableData . Please make sure that the product of TableData.getRow_count and TableData.getCol_count in data is the same as the number of cell_array, otherwise an exception will be thrown. Please make sure that the TableData.getRect 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 TableCellDataColArray objects. Exception com.foxit.sdk.common.Constants.e_ErrUnsupported 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.true means allow, false means not. Currently, cell merging is not supported if parameter allow_to_cross_page is true.
  [in] | tablegenerator_callback | The callback for table generator, which is implemented based on callback class com.foxit.sdk.addon.tablegenerator.TableGeneratorCallback .

Returns
  true means success, while false means failure.