23#ifndef MUPDF_FITZ_STRUCTURED_TEXT_H
24#define MUPDF_FITZ_STRUCTURED_TEXT_H
997 const char *datadir,
int (*progress)(
fz_context *,
void *,
int),
void *progress_arg);
1000 const char *datadir,
int (*progress)(
fz_context *,
void *,
int),
void *progress_arg,
fz_options *options);
fz_structure
Definition device.h:194
#define FZ_DATA
Definition export.h:49
void HEAP_TYPE_NAME HEAP_CONTAINER_TYPE v
Definition heap-imp.h:51
struct fz_pool_array fz_pool_array
Definition pool.h:83
struct fz_pool fz_pool
Definition pool.h:34
Definition document.h:1080
Definition structured-text.h:1327
int combine_image
Definition structured-text.h:1331
int max_size
Definition structured-text.h:1329
Definition structured-text.h:55
fz_matrix inv_matrix
Definition structured-text.h:58
fz_layout_line * head
Definition structured-text.h:59
fz_matrix matrix
Definition structured-text.h:57
fz_pool * pool
Definition structured-text.h:56
fz_layout_char ** text_tailp
Definition structured-text.h:60
fz_layout_line ** tailp
Definition structured-text.h:59
Definition structured-text.h:40
float advance
Definition structured-text.h:41
float x
Definition structured-text.h:41
const char * p
Definition structured-text.h:42
struct fz_layout_char * next
Definition structured-text.h:43
Definition structured-text.h:47
fz_layout_char * text
Definition structured-text.h:50
struct fz_layout_line * next
Definition structured-text.h:51
float y
Definition structured-text.h:48
const char * p
Definition structured-text.h:49
float x
Definition structured-text.h:48
float font_size
Definition structured-text.h:48
Definition geometry.h:388
Definition geometry.h:187
Definition geometry.h:782
Definition geometry.h:231
Definition structured-text.h:1075
int end_seq
Definition structured-text.h:1079
fz_stext_position end
Definition structured-text.h:1078
fz_search_quad * quads
Definition structured-text.h:1077
int num_quads
Definition structured-text.h:1076
fz_stext_position begin
Definition structured-text.h:1078
int begin_seq
Definition structured-text.h:1079
Definition structured-text.h:1060
fz_quad quad
Definition structured-text.h:1062
int seq
Definition structured-text.h:1061
Definition structured-text.h:1086
fz_search_reason reason
Definition structured-text.h:1087
fz_search_match * match
Definition structured-text.h:1091
int seq_needed
Definition structured-text.h:1090
Definition structured-text.h:446
fz_stext_grid_positions * ys
Definition structured-text.h:455
fz_stext_line * first_line
Definition structured-text.h:451
fz_rect bbox
Definition structured-text.h:449
int index
Definition structured-text.h:453
fz_stext_struct * down
Definition structured-text.h:453
union fz_stext_block::@077362170310250171051263324125052311301222304301 u
int type
Definition structured-text.h:447
struct fz_stext_block::@077362170310250171051263324125052311301222304301::@021205265155363355073277254035272225221124241246 t
fz_image * image
Definition structured-text.h:452
uint32_t argb
Definition structured-text.h:454
fz_stext_line * last_line
Definition structured-text.h:451
int flags
Definition structured-text.h:451
fz_stext_block * next
Definition structured-text.h:457
struct fz_stext_block::@077362170310250171051263324125052311301222304301::@327344140155077055150246014234231037205130331223 s
int id
Definition structured-text.h:448
struct fz_stext_block::@077362170310250171051263324125052311301222304301::@111221327166006002060050002366241076201217174261 i
fz_stext_grid_positions * xs
Definition structured-text.h:455
fz_stext_block * prev
Definition structured-text.h:457
fz_stext_grid_info * info
Definition structured-text.h:455
fz_matrix transform
Definition structured-text.h:452
struct fz_stext_block::@077362170310250171051263324125052311301222304301::@026234261360145277267111044143002132007263106067 b
Definition structured-text.h:483
fz_stext_char * next
Definition structured-text.h:492
fz_quad quad
Definition structured-text.h:489
uint32_t argb
Definition structured-text.h:487
fz_font * font
Definition structured-text.h:491
int c
Definition structured-text.h:484
float size
Definition structured-text.h:490
fz_point origin
Definition structured-text.h:488
uint16_t flags
Definition structured-text.h:486
uint16_t bidi
Definition structured-text.h:485
Definition structured-text.h:573
float max
Definition structured-text.h:577
int uncertainty
Definition structured-text.h:578
float pos
Definition structured-text.h:575
float min
Definition structured-text.h:576
int reinforcement
Definition structured-text.h:574
Definition structured-text.h:427
unsigned int flags
Definition structured-text.h:437
int h
Definition structured-text.h:434
int w
Definition structured-text.h:433
Definition structured-text.h:582
int len
Definition structured-text.h:583
int max_uncertainty
Definition structured-text.h:584
fz_stext_grid_divider list[FZ_FLEXIBLE_ARRAY]
Definition structured-text.h:585
Definition structured-text.h:469
fz_stext_line * next
Definition structured-text.h:475
fz_stext_char * first_char
Definition structured-text.h:474
uint8_t flags
Definition structured-text.h:471
fz_stext_char * last_char
Definition structured-text.h:474
uint8_t wmode
Definition structured-text.h:470
fz_rect bbox
Definition structured-text.h:473
fz_point dir
Definition structured-text.h:472
fz_stext_line * prev
Definition structured-text.h:475
Definition structured-text.h:763
float scale
Definition structured-text.h:765
fz_rect clip
Definition structured-text.h:766
int flags
Definition structured-text.h:764
fz_table_hunt_options table_hunt_options
Definition structured-text.h:767
Definition structured-text.h:1194
fz_stext_struct * parent
Definition structured-text.h:1196
fz_stext_struct * top
Definition structured-text.h:1198
fz_stext_block * block
Definition structured-text.h:1197
fz_stext_page * page
Definition structured-text.h:1195
Definition structured-text.h:329
int page
Definition structured-text.h:332
fz_rect mediabox
Definition structured-text.h:330
int chapter
Definition structured-text.h:331
Definition structured-text.h:344
fz_stext_block * first_block
Definition structured-text.h:348
fz_pool_array * id_list
Definition structured-text.h:358
fz_pool * pool
Definition structured-text.h:346
int refs
Definition structured-text.h:345
fz_rect mediabox
Definition structured-text.h:347
fz_stext_block * last_block
Definition structured-text.h:354
fz_stext_struct * last_struct
Definition structured-text.h:355
Definition structured-text.h:1066
fz_stext_line * line
Definition structured-text.h:1070
fz_stext_block * block
Definition structured-text.h:1069
fz_stext_struct * parent
Definition structured-text.h:1068
fz_stext_char * ch
Definition structured-text.h:1071
fz_stext_page * page
Definition structured-text.h:1067
Definition structured-text.h:521
fz_stext_block * up
Definition structured-text.h:523
fz_stext_struct * parent
Definition structured-text.h:527
fz_structure standard
Definition structured-text.h:538
fz_stext_block * first_block
Definition structured-text.h:531
char raw[FZ_FLEXIBLE_ARRAY]
Definition structured-text.h:541
fz_stext_block * last_block
Definition structured-text.h:534
Definition structured-text.h:730
int vertically_collapse_bordered_cells
Definition structured-text.h:731
fz_search_options
Definition structured-text.h:1022
@ FZ_SEARCH_EXACT
Definition structured-text.h:1023
@ FZ_SEARCH_IGNORE_CASE
Definition structured-text.h:1024
@ FZ_SEARCH_REGEXP
Definition structured-text.h:1026
@ FZ_SEARCH_KEEP_PARAGRAPHS
Definition structured-text.h:1028
@ FZ_SEARCH_KEEP_HYPHENS
Definition structured-text.h:1029
@ FZ_SEARCH_KEEP_LINES
Definition structured-text.h:1027
@ FZ_SEARCH_IGNORE_DIACRITICS
Definition structured-text.h:1025
fz_stext_options * fz_parse_stext_options(fz_context *ctx, fz_stext_options *opts, const char *string)
struct fz_flotilla fz_flotilla
Definition structured-text.h:1357
void fz_init_search_options(fz_context *ctx, fz_search_options *options)
fz_document * fz_open_reflowed_document(fz_context *ctx, fz_document *underdoc, const fz_stext_options *opts)
fz_stext_page_block_iterator fz_stext_page_block_iterator_begin_from_rdfs(fz_stext_page *page, fz_stext_block *block, fz_stext_struct *top)
int fz_is_unicode_hyphen(int c)
FZ_DATA const char * fz_search_options_usage
fz_stext_page_block_iterator fz_stext_page_block_iterator_begin_from(fz_stext_page *page, fz_stext_block *block, fz_stext_struct *top)
@ FZ_STEXT_VECTOR_IS_STROKED
Definition structured-text.h:393
@ FZ_STEXT_VECTOR_IS_HIGHLIGHT
Definition structured-text.h:406
@ FZ_STEXT_VECTOR_IS_STRIKEOUT
Definition structured-text.h:408
@ FZ_STEXT_VECTOR_IS_UNDERLINE
Definition structured-text.h:407
@ FZ_STEXT_VECTOR_CONTINUES
Definition structured-text.h:402
@ FZ_STEXT_VECTOR_IS_RECTANGLE
Definition structured-text.h:397
fz_stext_page_block_iterator fz_stext_page_block_iterator_begin_from_dfs(fz_stext_page *page, fz_stext_block *block, fz_stext_struct *top)
fz_stext_page_block_iterator fz_stext_page_block_iterator_begin(fz_stext_page *page)
void fz_print_stext_header_as_html(fz_context *ctx, fz_output *out)
fz_stext_line_flags
Definition structured-text.h:461
@ FZ_STEXT_LINE_FLAGS_JOINED
Definition structured-text.h:462
@ FZ_STEXT_STRIKEOUT
Definition structured-text.h:497
@ FZ_STEXT_CLIPPED
Definition structured-text.h:503
@ FZ_STEXT_FILLED
Definition structured-text.h:501
@ FZ_STEXT_UNICODE_IS_CID
Definition structured-text.h:504
@ FZ_STEXT_SYNTHETIC_LARGE
Definition structured-text.h:506
@ FZ_STEXT_STROKED
Definition structured-text.h:502
@ FZ_STEXT_UNDERLINE
Definition structured-text.h:498
@ FZ_STEXT_UNICODE_IS_GID
Definition structured-text.h:505
@ FZ_STEXT_BOLD
Definition structured-text.h:500
@ FZ_STEXT_SYNTHETIC
Definition structured-text.h:499
@ FZ_STEXT_HIGHLIGHT
Definition structured-text.h:507
fz_stext_page_block_iterator fz_stext_page_block_iterator_up(fz_stext_page_block_iterator pos)
void fz_print_stext_header_as_xhtml(fz_context *ctx, fz_output *out)
void fz_print_stext_page_as_xml(fz_context *ctx, fz_output *out, fz_stext_page *page, int id)
int fz_stext_page_block_iterator_eod_dfs(fz_stext_page_block_iterator pos)
fz_stext_page_block_iterator fz_stext_page_block_iterator_begin_dfs(fz_stext_page *page)
fz_stext_page_block_iterator fz_stext_page_block_iterator_next_rdfs(fz_stext_page_block_iterator pos)
int fz_match_callback_fn(fz_context *ctx, void *opaque, int num_quads, fz_quad *hit_bbox, int chapter, int page)
Definition structured-text.h:676
fz_stext_page * fz_keep_stext_page(fz_context *ctx, fz_stext_page *page)
void fz_drop_layout(fz_context *ctx, fz_layout_block *block)
fz_stext_xml_flags
Definition structured-text.h:624
@ FZ_STEXT_XML_FLAGS_CHARS
Definition structured-text.h:625
@ FZ_STEXT_XML_FLAGS_POINTERS
Definition structured-text.h:626
int fz_stext_remove_page_fill(fz_context *ctx, fz_stext_page *page)
fz_stext_page * fz_new_stext_page(fz_context *ctx, fz_rect mediabox)
int fz_segment_stext_rect(fz_context *ctx, fz_stext_page *page, fz_rect rect)
fz_stext_block * fz_find_table_within_bounds(fz_context *ctx, fz_stext_page *page, fz_rect bounds, const fz_table_hunt_options *opts)
void fz_init_stext_options(fz_context *ctx, fz_stext_options *opts)
void fz_init_table_hunt_options(fz_context *ctx, fz_table_hunt_options *opts)
fz_search * fz_new_search(fz_context *ctx, const char *needle, fz_search_options options)
fz_stext_page_block_iterator fz_stext_page_block_iterator_next_dfs(fz_stext_page_block_iterator pos)
fz_stext_page_block_iterator fz_stext_page_block_iterator_down(fz_stext_page_block_iterator pos)
fz_search_options * fz_parse_search_options(fz_context *ctx, fz_search_options *options, const char *args)
fz_quad fz_snap_selection(fz_context *ctx, fz_stext_page *page, fz_point *ap, fz_point *bp, int mode)
void fz_drop_search(fz_context *ctx, fz_search *search)
void fz_print_stext_trailer_as_html(fz_context *ctx, fz_output *out)
int fz_segment_stext_page(fz_context *ctx, fz_stext_page *page)
void fz_print_stext_page_as_html(fz_context *ctx, fz_output *out, fz_stext_page *page, int id)
fz_rect fz_flotilla_raft_area(fz_context *ctx, fz_flotilla *flot, int i)
fz_search_reason
Definition structured-text.h:1048
@ FZ_SEARCH_MORE_INPUT
Definition structured-text.h:1050
@ FZ_SEARCH_COMPLETE
Definition structured-text.h:1056
@ FZ_SEARCH_MATCH
Definition structured-text.h:1053
void fz_verify_stext_page(fz_context *ctx, fz_stext_page *page, const char *title)
int fz_flotilla_size(fz_context *ctx, fz_flotilla *flot)
int fz_is_unicode_space_equivalent(int c)
fz_search_result fz_search_forwards(fz_context *ctx, fz_search *search)
int fz_propose_table_within_bounds(fz_context *ctx, fz_stext_page *page, fz_rect bounds, fz_stext_grid_positions **xposp, fz_stext_grid_positions **yposp, const fz_table_hunt_options *opts)
void fz_drop_stext_page(fz_context *ctx, fz_stext_page *page)
void fz_paragraph_break(fz_context *ctx, fz_stext_page *page)
void fz_table_hunt_within_bounds(fz_context *ctx, fz_stext_page *page, fz_rect bounds, const fz_table_hunt_options *opts)
void fz_drop_flotilla(fz_context *ctx, fz_flotilla *f)
fz_stext_block * fz_new_stext_struct(fz_context *ctx, fz_stext_page *page, fz_structure standard, const char *raw, int index)
char * fz_copy_rectangle(fz_context *ctx, fz_stext_page *page, fz_rect area, int crlf)
@ FZ_TABLE_HUNT_VERTICAL_COLLAPSE_YES
Definition structured-text.h:739
@ FZ_TABLE_HUNT_VERTICAL_COLLAPSE_NO
Definition structured-text.h:736
int fz_search_callback_fn(fz_context *ctx, void *opaque, int num_quads, fz_quad *hit_bbox)
Definition structured-text.h:666
fz_layout_block * fz_new_layout(fz_context *ctx)
fz_stext_page_details * fz_stext_page_details_for_block(fz_context *ctx, fz_stext_page *page, fz_stext_block *block)
fz_stext_page_block_iterator fz_stext_page_block_iterator_begin_rdfs(fz_stext_page *page)
int fz_stext_page_block_iterator_eod_rdfs(fz_stext_page_block_iterator pos)
void fz_apply_stext_options(fz_context *ctx, fz_stext_options *opts, fz_options *options)
fz_device * fz_new_ocr_device(fz_context *ctx, fz_device *target, fz_matrix ctm, fz_rect mediabox, int with_list, const char *language, const char *datadir, int(*progress)(fz_context *, void *, int), void *progress_arg)
@ FZ_SELECT_WORDS
Definition structured-text.h:702
@ FZ_SELECT_LINES
Definition structured-text.h:703
@ FZ_SELECT_CHARS
Definition structured-text.h:701
int fz_search_stext_page_cb(fz_context *ctx, fz_stext_page *text, const char *needle, fz_search_callback_fn *cb, void *opaque)
fz_table_hunt_options * fz_parse_table_hunt_options(fz_context *ctx, fz_table_hunt_options *opts, const char *args)
void fz_print_stext_page_as_json(fz_context *ctx, fz_output *out, fz_stext_page *page, float scale)
fz_flotilla * fz_new_flotilla_from_stext_page_vectors(fz_context *ctx, fz_stext_page *page)
int fz_search_stext_page(fz_context *ctx, fz_stext_page *text, const char *needle, int *hit_mark, fz_quad *hit_bbox, int hit_max)
fz_device * fz_new_stext_device(fz_context *ctx, fz_stext_page *page, const fz_stext_options *options)
void fz_print_stext_page_as_text(fz_context *ctx, fz_output *out, fz_stext_page *page)
void fz_add_layout_line(fz_context *ctx, fz_layout_block *block, float x, float y, float h, const char *p)
FZ_DATA const char * fz_stext_options_usage
void fz_classify_stext_rect(fz_context *ctx, fz_stext_page *page, fz_structure classification, fz_rect rect)
fz_stext_block * fz_find_table_within_grid(fz_context *ctx, fz_stext_page *page, fz_stext_grid_positions *xpos, fz_stext_grid_positions *ypos, float limit, const fz_table_hunt_options *opts)
int fz_match_stext_page_cb(fz_context *ctx, fz_stext_page *page, const char *needle, fz_match_callback_fn *cb, void *opaque, fz_search_options options)
void fz_print_stext_page_as_xml_with_flags(fz_context *ctx, fz_output *out, fz_stext_page *page, int id, fz_stext_xml_flags flags)
void fz_apply_search_options(fz_context *ctx, fz_search_options *options, fz_options *opts)
int fz_match_stext_page(fz_context *ctx, fz_stext_page *text, const char *needle, int *hit_mark, fz_quad *hit_bbox, int hit_max, fz_search_options options)
void fz_debug_stext_page(fz_context *ctx, fz_stext_page *page, int id)
@ FZ_STEXT_BLOCK_GRID
Definition structured-text.h:377
@ FZ_STEXT_BLOCK_TEXT
Definition structured-text.h:373
@ FZ_STEXT_BLOCK_IMAGE
Definition structured-text.h:374
@ FZ_STEXT_BLOCK_VECTOR
Definition structured-text.h:376
@ FZ_STEXT_BLOCK_STRUCT
Definition structured-text.h:375
struct fz_search fz_search
Definition structured-text.h:1019
fz_search_result fz_search_backwards(fz_context *ctx, fz_search *search)
fz_device * fz_new_stext_device_for_page(fz_context *ctx, fz_stext_page *stext_page, const fz_stext_options *opts, int chapter_num, int page_num, fz_rect mediabox)
void fz_stext_raft_images(fz_context *ctx, fz_stext_page *stext, fz_image_raft_options *options)
void fz_feed_search(fz_context *ctx, fz_search *search, fz_stext_page *page, int seq)
void fz_apply_table_hunt_options(fz_context *ctx, fz_table_hunt_options *opts, fz_options *options)
char * fz_copy_selection(fz_context *ctx, fz_stext_page *page, fz_point a, fz_point b, int crlf)
int fz_highlight_selection(fz_context *ctx, fz_stext_page *page, fz_point a, fz_point b, fz_quad *quads, int max_quads)
@ FZ_STEXT_FUZZY_VECTORS
Definition structured-text.h:217
@ FZ_STEXT_CLIP_RECT
Definition structured-text.h:213
@ FZ_STEXT_INHIBIT_SPACES
Definition structured-text.h:199
@ FZ_STEXT_COLLECT_VECTORS
Definition structured-text.h:206
@ FZ_STEXT_TABLE_HUNT
Definition structured-text.h:210
@ FZ_STEXT_COLLECT_STYLES
Definition structured-text.h:211
@ FZ_STEXT_ACCURATE_BBOXES
Definition structured-text.h:205
@ FZ_STEXT_IGNORE_ACTUALTEXT
Definition structured-text.h:207
@ FZ_STEXT_ACCURATE_ASCENDERS
Definition structured-text.h:214
@ FZ_STEXT_PRESERVE_SPANS
Definition structured-text.h:201
@ FZ_STEXT_PRESERVE_WHITESPACE
Definition structured-text.h:197
@ FZ_STEXT_MEDIABOX_CLIP
Definition structured-text.h:220
@ FZ_STEXT_DEHYPHENATE
Definition structured-text.h:200
@ FZ_STEXT_SEGMENT
Definition structured-text.h:208
@ FZ_STEXT_CLIP
Definition structured-text.h:202
@ FZ_STEXT_USE_CID_FOR_UNKNOWN_UNICODE
Definition structured-text.h:203
@ FZ_STEXT_LAZY_VECTORS
Definition structured-text.h:216
@ FZ_STEXT_PRESERVE_LIGATURES
Definition structured-text.h:196
@ FZ_STEXT_USE_GID_FOR_UNKNOWN_UNICODE
Definition structured-text.h:212
@ FZ_STEXT_PARAGRAPH_BREAK
Definition structured-text.h:209
@ FZ_STEXT_COLLECT_STRUCTURE
Definition structured-text.h:204
@ FZ_STEXT_PRESERVE_IMAGES
Definition structured-text.h:198
@ FZ_STEXT_ACCURATE_SIDE_BEARINGS
Definition structured-text.h:215
int fz_is_unicode_whitespace(int c)
void fz_table_hunt(fz_context *ctx, fz_stext_page *page, const fz_table_hunt_options *opts)
void fz_print_stext_page_as_xhtml(fz_context *ctx, fz_output *out, fz_stext_page *page, int id)
void fz_print_stext_trailer_as_xhtml(fz_context *ctx, fz_output *out)
fz_device * fz_new_ocr_device_with_options(fz_context *ctx, fz_device *target, fz_matrix ctm, fz_rect mediabox, int with_list, const char *language, const char *datadir, int(*progress)(fz_context *, void *, int), void *progress_arg, fz_options *options)
fz_stext_page_block_iterator fz_stext_page_block_iterator_next(fz_stext_page_block_iterator pos)
@ FZ_STEXT_TEXT_JUSTIFY_RIGHT
Definition structured-text.h:385
@ FZ_STEXT_TEXT_JUSTIFY_UNKNOWN
Definition structured-text.h:382
@ FZ_STEXT_TEXT_JUSTIFY_LEFT
Definition structured-text.h:383
@ FZ_STEXT_TEXT_JUSTIFY_CENTER
Definition structured-text.h:384
@ FZ_STEXT_TEXT_JUSTIFY_FULL
Definition structured-text.h:386
@ FZ_STEXT_GRID_V_CROSSED
Definition structured-text.h:416
@ FZ_STEXT_GRID_H_CROSSED
Definition structured-text.h:414
@ FZ_STEXT_GRID_T_BORDER
Definition structured-text.h:420
@ FZ_STEXT_GRID_L_BORDER
Definition structured-text.h:418
@ FZ_STEXT_GRID_FULL
Definition structured-text.h:422
void fz_add_layout_char(fz_context *ctx, fz_layout_block *block, float x, float w, const char *p)
int fz_stext_page_block_iterator_eod(fz_stext_page_block_iterator pos)
#define FZ_FLEXIBLE_ARRAY
Definition system.h:46