1 #ifndef FS_TABLEGENERATOR_H_
2 #define FS_TABLEGENERATOR_H_
7 #ifndef __EMSCRIPTEN_RENDER__
24 namespace tablegenerator {
33 typedef enum _TableBorderStyle {
123 return !((*this) == data);
189 : cell_text_style(
foxit::pdf::RichTextStyle())
190 , cell_fill_color(0xFFFFFFFF)
192 , cell_margin(
RectF()) {}
204 :cell_text_style(cell_text_style)
205 ,cell_fill_color(cell_fill_color)
206 ,cell_text(cell_text)
207 ,cell_image(cell_image)
208 ,cell_margin(cell_margin) {}
216 : cell_text_style(data.cell_text_style)
217 , cell_fill_color(data.cell_fill_color)
218 , cell_text(data.cell_text)
219 , cell_image(data.cell_image)
220 , cell_margin(data.cell_margin) {}
261 return !((*this) == data);
276 this->cell_text_style = cell_text_style;
277 this->cell_fill_color = cell_fill_color;
278 this->cell_text = cell_text;
279 this->cell_image = cell_image;
280 this->cell_margin = cell_margin;
355 ,row_count(row_count)
356 ,col_count(col_count)
357 ,outside_border_left(outside_border_left)
358 ,outside_border_right(outside_border_right)
359 ,outside_border_top(outside_border_top)
360 ,outside_border_bottom(outside_border_bottom)
361 ,inside_border_row(inside_border_row)
362 ,inside_border_col(inside_border_col)
363 ,merge_cells(merge_cells)
364 ,row_height_array(row_height_array)
365 ,col_width_array(col_width_array) {
375 ,row_count(data.row_count)
376 ,col_count(data.col_count)
377 ,outside_border_left(data.outside_border_left)
378 ,outside_border_right(data.outside_border_right)
379 ,outside_border_top(data.outside_border_top)
380 ,outside_border_bottom(data.outside_border_bottom)
381 ,inside_border_row(data.inside_border_row)
382 ,inside_border_col(data.inside_border_col)
383 ,merge_cells(data.merge_cells)
384 ,row_height_array(data.row_height_array)
385 ,col_width_array(data.col_width_array) {
397 for (
size_t i = 0; i < merge_cells.GetSize(); i++)
400 for (
int i = 0; i < row_height_array.GetSize(); i++)
403 for (
int i = 0; i < col_width_array.GetSize(); i++)
405 return (rect == data.
rect &&
424 return !((*this) == data);
472 this->row_count = row_count;
473 this->col_count = col_count;
474 this->outside_border_left = outside_border_left;
475 this->outside_border_right = outside_border_right;
476 this->outside_border_top = outside_border_top;
477 this->outside_border_bottom = outside_border_bottom;
478 this->inside_border_row = inside_border_row;
479 this->inside_border_col = inside_border_col;
480 this->merge_cells = merge_cells;
481 this->row_height_array = row_height_array;
482 this->col_width_array = col_width_array;
TableBorderInfo(const TableBorderInfo &table_border_info)
Constructor, with another table border information object.
Definition: fs_tablegenerator.h:74
int GetSize() const
Get the number of elements in the array.
Definition: fx_basic.h:1360
FloatArray col_width_array
The column width array. The column width will be set as default value automatically if the member of ...
Definition: fs_tablegenerator.h:528
static bool AddTableToPage(const foxit::pdf::PDFPage &page, const TableData &data, const TableCellDataArray &cell_array)
Add a new table to the PDF page.
Definition: fs_tablegenerator.h:321
foxit::pdf::RichTextStyle cell_text_style
The style of cell text.
Definition: fs_tablegenerator.h:284
CFX_Object Object
Object type.
Definition: fs_basictypes.h:221
CFX_Point TableCellIndex
The table cell index.The x means the row index of cell and the y means the column index of cell.
Definition: fs_tablegenerator.h:315
TableData(const TableData &data)
Constructor, with another table cell data object.
Definition: fs_tablegenerator.h:373
TableCellData(const foxit::pdf::RichTextStyle &cell_text_style, const ARGB cell_fill_color, const WString &cell_text, const foxit::common::Image &cell_image, const RectF &cell_margin)
Constructor, with parameters.
Definition: fs_tablegenerator.h:203
TableBorderInfo outside_border_right
The right outside border info.
Definition: fs_tablegenerator.h:501
Header file for common definitions and classes.
float dash_phase
Dash phase.It should not be negative. Only useful when parameter style</ i> is TableBorderInfo::e_Tab...
Definition: fs_tablegenerator.h:168
TableData()
Constructor.
Definition: fs_tablegenerator.h:324
Table border style: Dashed.
Definition: fs_tablegenerator.h:37
Table border style: Solid.
Definition: fs_tablegenerator.h:35
ARGB color
The table border color. Format: 0xAARRGGBB.
Definition: fs_tablegenerator.h:162
An array of table cell index.
Definition: fs_tablegenerator.h:318
uint32 ARGB
ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_basictypes.h:210
virtual float GetTableTopMarginToPage(int page_index)=0
A callback function to get the top margin of the table to be generated to a new page.
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.
FloatArray dashes
A dash array that represents the dash patterns. The value of each element in this array should not be...
Definition: fs_tablegenerator.h:175
Definition: fs_tablegenerator.h:185
float line_width
Table border line width, in points. This should be a non-negative value. If this value is 0,...
Definition: fs_tablegenerator.h:159
void Set(RectF rect, int row_count, int col_count, TableBorderInfo outside_border_left, TableBorderInfo outside_border_right, TableBorderInfo outside_border_top, TableBorderInfo outside_border_bottom, TableBorderInfo inside_border_row, TableBorderInfo inside_border_col, TableCellIndexArray merge_cells, FloatArray row_height_array, FloatArray col_width_array)
Set value.
Definition: fs_tablegenerator.h:468
int col_count
The count of columns in the table.
Definition: fs_tablegenerator.h:495
TableBorderInfo & operator=(const TableBorderInfo &data)
Assign operator.
Definition: fs_tablegenerator.h:88
void Set(const foxit::pdf::RichTextStyle &cell_text_style, const ARGB cell_fill_color, const WString &cell_text, const foxit::common::Image &cell_image, const RectF &cell_margin)
Set value.
Definition: fs_tablegenerator.h:275
TableBorderInfo outside_border_bottom
The bottom outside border info.
Definition: fs_tablegenerator.h:507
Definition: fs_annot.h:204
TableBorderInfo outside_border_top
The top outside border info.
Definition: fs_tablegenerator.h:504
This class represents an array of TableCellData objects,inserted in the order of the displayed table ...
Definition: fs_tablegenerator.h:180
TableCellData()
Constructor.
Definition: fs_tablegenerator.h:188
Definition: fx_coordinates.h:30
const TYPE GetAt(int nIndex) const
This method retrieves an element specified by an index number.
Definition: fx_basic.h:1396
TableCellIndexArray merge_cells
The merge cells. The length of this array must be even and the zero length means no merge cell.
Definition: fs_tablegenerator.h:522
RectF cell_margin
The cell margin between the content and cell border.
Definition: fs_tablegenerator.h:311
TableBorderStyle table_border_style
Table border style. Please refer to values starting from TableBorderInfo::e_TableBorderStyleSolid and...
Definition: fs_tablegenerator.h:153
TableBorderStyle
Enumeration for PDF annotation type.
Definition: fs_tablegenerator.h:33
bool operator==(const char *str1, const CFX_ByteString &str2)
Check if two byte strings are equal.
Definition: fs_basictypes.h:128
TableCellData(const TableCellData &data)
Constructor, with another table cell data object.
Definition: fs_tablegenerator.h:215
virtual foxit::pdf::PageBasicInfo GetNewPageBasicInfo(int page_index, float rest_table_height, float table_width)=0
A callback function to get new page basic information to be generated to a new page.
Definition: fs_pdfdoc.h:492
Header file for PDF page related definitions and classes.
Definition: fs_tablegenerator.h:182
Foxit namespace.
Definition: fs_taggedpdf.h:27
TableBorderInfo inside_border_row
The row inside border info.
Definition: fs_tablegenerator.h:510
Definition: fs_tablegenerator.h:26
TableBorderInfo(const TableBorderStyle &table_border_style, float line_width, ARGB color, float dash_phase, FloatArray dashes)
Constructor, with parameters.
Definition: fs_tablegenerator.h:62
FloatArray row_height_array
The row height array. The row height will be set as default value automatically if the member of arra...
Definition: fs_tablegenerator.h:525
bool operator==(const TableBorderInfo &table_border_info) const
Equal operator.
Definition: fs_tablegenerator.h:104
bool operator!=(const char *str1, const CFX_ByteString &str2)
Check if two byte strings are not equal.
Definition: fs_basictypes.h:140
TableBorderInfo()
Constructor.
Definition: fs_tablegenerator.h:42
bool operator!=(const TableBorderInfo &data) const
Not equal operator.
Definition: fs_tablegenerator.h:122
TableData(RectF rect, int row_count, int col_count, TableBorderInfo outside_border_left, TableBorderInfo outside_border_right, TableBorderInfo outside_border_top, TableBorderInfo outside_border_bottom, TableBorderInfo inside_border_row, TableBorderInfo inside_border_col, TableCellIndexArray merge_cells, FloatArray row_height_array, FloatArray col_width_array)
Constructor, with parameters.
Definition: fs_tablegenerator.h:351
Header file for PDF document related definitions and classes.
foxit::common::Image cell_image
The image content of cell.
Definition: fs_tablegenerator.h:303
#define NULL
The null-pointer value.
Definition: fx_system.h:792
TableBorderInfo outside_border_left
The left outside border info.
Definition: fs_tablegenerator.h:498
Definition: fx_coordinates.h:771
TableCellIndex GetAt(size_t index) const
Retrieve a copy of the element at position specified by index in current array.
int row_count
The count of rows in the table.
Definition: fs_tablegenerator.h:492
Definition: fs_pdfdoc.h:772
Definition: fs_pdfpage.h:412
size_t GetSize() const
Get the size of elements in current array.
virtual void Release()=0
A callback function used to release current callback object itself.
Definition: fs_image.h:460
Definition: fs_tablegenerator.h:535
Definition: fs_tablegenerator.h:576
ARGB cell_fill_color
The fill color of cell. Format: 0xAARRGGBB.
Definition: fs_tablegenerator.h:287
Header file for annotation related definitions and classes.
TableBorderInfo inside_border_col
The column inside border info.
Definition: fs_tablegenerator.h:513
WIDE STRING CLASS.
Definition: fx_string.h:1461
Definition: fs_basictypes.h:449
void Set(const TableBorderStyle &table_border_style, float line_width, ARGB color, float dash_phase, FloatArray dashes)
Set value.
Definition: fs_tablegenerator.h:141
WString cell_text
The text content of cell.
Definition: fs_tablegenerator.h:295
RectF rect
Rectangle of the table which specifies the position in PDF page. It should be in PDF coordinate syste...
Definition: fs_tablegenerator.h:489
@2025 Foxit Software Incorporated. All rights reserved.