Module to create tables on a PDF page. More...

Data Structures

struct  A3DPDFTableCellDescData
 Structure to define a table cell. More...
 
struct  A3DPDFTableData
 Structure to define a table. More...
 
struct  A3DPDFTableDescData
 Structure to define a table from API. More...
 
struct  A3DPDFTableRowDescData
 Structure to define a table row. More...
 
struct  A3DPDFTableStyleData
 Structure to define a table style. More...
 

Functions

A3DStatus A3DPDFPageInsertTable (A3DPDFPage *pPage, A3DPDFTable *pTable, const A3DInt32 iPosLeft, const A3DInt32 iPosTop)
 Function to insert a table in a page. More...
 
A3DStatus A3DPDFTableCellDescCreate (const A3DPDFTableCellDescData *pCellDescData, A3DPDFTableCellDesc **ppCellDesc)
 Function to create a cell in a table on a PDF page, from an API definition. More...
 
A3DStatus A3DPDFTableCreate (A3DPDFDocument *pDoc, const A3DPDFTableData *pTableData, A3DPDFTable **ppTable)
 Function to create a table on a PDF page. More...
 
A3DStatus A3DPDFTableCreateFromDesc (A3DPDFDocument *pDoc, const A3DPDFTableDescData *pTableData, A3DPDFTable **ppTable)
 Function to create a table on a PDF page, from an API definition. More...
 
A3DStatus A3DPDFTableRowDescCreate (A3DPDFTableRowDescData *pRowDescData, A3DPDFTableRowDesc **ppRowDesc)
 Function to create a row in a table on a PDF page, from an API definition. More...
 

Detailed Description

Module to create tables on a PDF page.

This module describes the functions and structures that allow you to define tables on a PDF page. The table implementation uses an add-on to HOOPS Publish (TableToPDF) which is provided for free by Tech Soft 3D. The add-on is using components that are licensed under GNU LGPL terms. Consequently, the usage of tables using HOOPS Publish add-on requires our customer's application to comply with LGPL requirements. TableToPDF can be downloaded at http://developer.techsoft3d.com/add-ons/tabletopdf/ The deployment process is simple and just requires to copy the provided DLLs in HOOPS Publish binaries folder.

With HOOPS Publish, tables are defined in a HTML format using the function A3DPDFTableCreate. Two parameters define the table: the table content definition, as well as a style definition. Then, the table is positioned on the PDF page using the function A3DPDFPageInsertTable.

The HTML and style definition is out of the scope of this guide. HOOPS Publish and TableToPDF support the latest HTML5 and CSS3 specifications which are widely documented on the Internet. A lot of guides and samples can be consulted.

As an example, the following simple table

sampletable.png

is defined with HOOPS Publish by specifying the members of A3DPDFTableData :

The member A3DPDFTableData::m_pcHtmlTable member takes the following value:

<table class="gridtable">
<tr>
<th>Name</th><th>City</th><th>Age</th>
</tr>
<tr>
<td>Bob</td><td>Seattle</td><td>35</td>
</tr>
<tr>
<td>Sandy</td><td>New York</td><td>32</td>
</tr>
</table>

The member A3DPDFTableData::m_pcHtmlStyle member takes the following value:

<style type="text/css">
table.gridtable {
font-family: helvetica;
font-size:11pt;
border-width: 1pt;
border-collapse: collapse;
}
table.gridtable th {
border-width: 1pt;
border-style: solid;
background-color: #dedede;
padding: 8pt;
}
table.gridtable td {
border-width: 1pt;
border-style: solid;
background-color: #ffffff;
padding: 8pt;
}
</style>

Function Documentation

◆ A3DPDFTableCreate()

A3DStatus A3DPDFTableCreate ( A3DPDFDocument pDoc,
const A3DPDFTableData pTableData,
A3DPDFTable **  ppTable 
)

Function to create a table on a PDF page.

The table object is primarily created with this function, and it should be positioned on the page with the function A3DPDFPageInsertTable. WARNING: the initialization function A3DPDFInitializePDFLibAndResourceDirectory must be called before using this function. Also, the binaries of the free add-on TableToPDF must have been copied in the same directory as HOOPS Publish binaries.

Parameters
[in,out]pDocThe Document object to work with.
[in]pTableDataThe table parameters.
[out]ppTableThe Table object created.
Returns
A3D_SUCCESS in case of success or an error code
Return values
A3D_SUCCESS
Version
5.1

◆ A3DPDFTableCellDescCreate()

A3DStatus A3DPDFTableCellDescCreate ( const A3DPDFTableCellDescData pCellDescData,
A3DPDFTableCellDesc **  ppCellDesc 
)

Function to create a cell in a table on a PDF page, from an API definition.

Parameters
[in,out]pDocThe Document object to work with.
[in]pCellDescDataThe cell description.
[out]ppCellDescThe Table object created.
Returns
A3D_SUCCESS in case of success or an error code
Return values
A3D_SUCCESS
Version
23.0

◆ A3DPDFTableRowDescCreate()

A3DStatus A3DPDFTableRowDescCreate ( A3DPDFTableRowDescData pRowDescData,
A3DPDFTableRowDesc **  ppRowDesc 
)

Function to create a row in a table on a PDF page, from an API definition.

Parameters
[in,out]pDocThe Document object to work with.
[in]pRowDescDataThe row description.
[out]ppRowDescThe Table object created.
Returns
A3D_SUCCESS in case of success or an error code
Return values
A3D_SUCCESS
Version
23.0

◆ A3DPDFTableCreateFromDesc()

A3DStatus A3DPDFTableCreateFromDesc ( A3DPDFDocument pDoc,
const A3DPDFTableDescData pTableData,
A3DPDFTable **  ppTable 
)

Function to create a table on a PDF page, from an API definition.

The table object is primarily created with this function, and it should be positioned on the page with the function A3DPDFPageInsertTable. WARNING: the initialization function A3DPDFInitializePDFLibAndResourceDirectory must be called before using this function.

Parameters
[in,out]pDocThe Document object to work with.
[in]pTableDataThe table description.
[out]ppTableThe Table object created.
Returns
A3D_SUCCESS in case of success or an error code
Return values
A3D_SUCCESS
Version
23.0

◆ A3DPDFPageInsertTable()

A3DStatus A3DPDFPageInsertTable ( A3DPDFPage pPage,
A3DPDFTable pTable,
const A3DInt32  iPosLeft,
const A3DInt32  iPosTop 
)

Function to insert a table in a page.

Warning: The positioning is not defined as in the other insertion functions (for texts or images). Here, the position is specified from the top of the page.

Parameters
[in,out]pPageThe Page object to work with.
[in]pTableThe Table object to insert on the page.
[in]iPosLeftThe x coordinate of the insertion point of the table. The insertion point is the top left corner of the table. The coordinate origin (0, 0) is the bottom left of the page. The unit is point.
[in]iPosTopThe y coordinate of the insertion point of the table. The insertion point is the top left corner of the table. The coordinate origin (0, 0) is the bottom left of the page. The unit is point.
Returns
A3D_SUCCESS in case of success or an error code
Return values
A3D_SUCCESS
Version
5.1