Fortunately you don't have to do it all by yourself. libzvbi provides export modules converting a vbi_page into the desired format or rendering directly into memory.
A minimalistic export example:
static void export_my_page (vbi_page *pg) { vbi_export *ex; char *errstr; if (!(ex = vbi_export_new ("html", &errstr))) { fprintf (stderr, "Cannot export as HTML: %s\n", errstr); free (errstr); return; } if (!vbi_export_file (ex, "my_page.html", pg)) puts (vbi_export_errstr (ex)); vbi_export_delete (ex); }
|
Export module instance, an opaque object. Allocate with vbi_export_new(). |
|
|
Some modules may depend on machine features or the presence of certain libraries, thus the list can vary from session to session.
|
|
|
|
|
|
vbi_export_new ("keyword; quality=75.5, comment=\"example text\"");
|
|
|
|
|
|
|
|
Typical usage of vbi_export_option_set(): vbi_export_option_set (export, "quality", 75.5);
Mind that options of type
|
|
|
|
|
|
|
|
You can call this function as many times as you want, it does not change vbi_export state or the vbi_page.
|
|
You can call this function as many times as you want, it does not change vbi_export state or the vbi_page.
|
|
|