Defining a table with a data structure for the table.
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
static char *
cb_content(void *tag, size_t r, size_t c) {
static char buf[32];
#if (defined _WIN32 || defined __WIN32__)
if( 0==r )
snprintf(buf, sizeof buf, "Header %02ix%02i", r, c);
else
snprintf(buf, sizeof buf, "Content %02ix%02i", r, c);
#else
if( 0==r )
snprintf(buf, sizeof buf, "Header %02zux%02zu", r, c);
else
snprintf(buf, sizeof buf, "Content %02zux%02zu", r, c);
#endif
return buf;
}
static char *
cb_label(void *tag, size_t r, size_t c) {
static char buf[32];
#if (defined _WIN32 || defined __WIN32__)
if (0==r && 0==c) {
snprintf(buf, sizeof buf, "Date:");
} else {
snprintf(buf, sizeof buf, "Label %ix%i:", r, c);
}
#else
if (0==r && 0==c) {
snprintf(buf, sizeof buf, "Date:");
} else {
snprintf(buf, sizeof buf, "Label %zux%zu:", r, c);
}
#endif
return buf;
}
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif
.rows=4, .cols=3,
.content_cb=cb_content, .label_cb=cb_label,
.style_cb=NULL, .post_cb=NULL,
.cell_spec=NULL
};
void
create_table_ex13_1(HPDF_Doc pdf_doc, HPDF_Page pdf_page) {
}
int hpdftbl_stroke_from_data(HPDF_Doc pdf_doc, HPDF_Page pdf_page, hpdftbl_spec_t *tbl_spec, hpdftbl_theme_t *theme)
Construct the table from a array specification.
Definition: hpdftbl.c:1265
#define TRUE
Boolean truth value.
Definition: hpdftbl.h:47
#define FALSE
Boolean false value.
Definition: hpdftbl.h:52
#define A4PAGE_HEIGHT_CM
Standard A4 paper height in cm.
Definition: hpdftbl.h:198
#define hpdftbl_cm2dpi(c)
Convert cm to dots using the default resolution (72 DPI)
Definition: hpdftbl.h:256
Used in data driven table creation.
Definition: hpdftbl.h:596
char * title
Definition: hpdftbl.h:598
Common functions for all unit-test/examples.
#define TUTEX_MAIN(_tbl_, _showgrid_)
Macro to create a main() function to call the table creation function for each example....
Definition: unit_test.inc.h:322