struct fz_write_story_position
{
fz_story_element_position element;
int page_num;
}
A fz_story_element_position plus page number information; used with fz_write_story() and fz_write_stabilized_story().
struct fz_write_story_positions
{
fz_write_story_position *positions;
int num;
}
A set of fz_write_story_position items; used with fz_write_stabilized_story().
typedef int (fz_write_story_rectfn)(fz_context *ctx, void *ref, int num, fz_rect filled, fz_rect *rect, fz_matrix *ctm, fz_rect *mediabox)
Callback type used by fz_write_story() and fz_write_stabilized_story().
Should set rect to rect number
typedef void (fz_write_story_positionfn)(fz_context *ctx, void *ref, const fz_write_story_position *position)
Callback used by fz_write_story() to report information about element
positions. Slightly different from fz_story_position_callback() because
typedef void (fz_write_story_pagefn)(fz_context *ctx, void *ref, int page_num, fz_rect mediabox, fz_device *dev, int after)
Callback for fz_write_story(), called twice for each page, before (after=0) and after (after=1) the story is written.
typedef void (fz_write_story_contentfn)(fz_context *ctx, void *ref, const fz_write_story_positions *positions, fz_buffer *buffer)
Callback type for fz_write_stabilized_story().
Should populate the supplied buffer with html content for use with
internal calls to fz_new_story(). This may include extra content derived
from information in
void
fz_write_story (
fz_context *ctx,
fz_document_writer *writer,
fz_story *story,
fz_write_story_rectfn rectfn,
void *rectfn_ref,
fz_write_story_positionfn positionfn,
void *positionfn_ref,
fz_write_story_pagefn pagefn,
void *pagefn_ref
)
Places and writes a story to a fz_document_writer. Avoids the need for calling code to implement a loop that calls fz_place_story() and fz_draw_story() etc, at the expense of having to provide a fz_write_story_rectfn() callback.
void
fz_write_stabilized_story (
fz_context *ctx,
fz_document_writer *writer,
const char *user_css,
float em,
fz_write_story_contentfn contentfn,
void *contentfn_ref,
fz_write_story_rectfn rectfn,
void *rectfn_ref,
fz_write_story_pagefn pagefn,
void *pagefn_ref,
fz_archive *dir
)
Does iterative layout of html content to a fz_document_writer. For example this allows one to add a table of contents section while ensuring that page numbers are patched up until stable.
Repeatedly creates new story from (contentfn(), contentfn_ref, user_css, em) and lays it out with internal call to fz_write_story(); uses a NULL writer and populates a fz_write_story_positions which is passed to the next call of contentfn().
When the html from contentfn() becomes unchanged, we do a final iteration using writer.