summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-07-27 14:24:55 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-07-27 14:48:25 +0200
commitf7f89d9d0073e583bc78e6a5d4fc55a533caa566 (patch)
treea9e9ccb34f63376911c7f484798e295f818a0d05 /include
parent44cff76eb82cf11097e4e01348240e3556e22a7f (diff)
downloadmupdf-f7f89d9d0073e583bc78e6a5d4fc55a533caa566.tar.xz
Add text format document writer.
Improve HTML output using absolute positioning, and add XHTML output for simpler semantic html output.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/structured-text.h20
-rw-r--r--include/mupdf/fitz/writer.h5
2 files changed, 15 insertions, 10 deletions
diff --git a/include/mupdf/fitz/structured-text.h b/include/mupdf/fitz/structured-text.h
index 26634fff..61ee30ad 100644
--- a/include/mupdf/fitz/structured-text.h
+++ b/include/mupdf/fitz/structured-text.h
@@ -250,24 +250,28 @@ void fz_drop_stext_page(fz_context *ctx, fz_stext_page *page);
void fz_analyze_text(fz_context *ctx, fz_stext_sheet *sheet, fz_stext_page *page);
/*
- fz_print_stext_sheet: Output a text sheet to a file as CSS.
+ fz_print_stext_page_as_html: Output a page to a file in HTML (visual) format.
*/
-void fz_print_stext_sheet(fz_context *ctx, fz_output *out, fz_stext_sheet *sheet);
+void fz_print_stext_page_as_html(fz_context *ctx, fz_output *out, fz_stext_page *page);
+void fz_print_stext_header_as_html(fz_context *ctx, fz_output *out);
+void fz_print_stext_trailer_as_html(fz_context *ctx, fz_output *out);
/*
- fz_print_stext_page_html: Output a page to a file in HTML format.
+ fz_print_stext_page_as_xhtml: Output a page to a file in XHTML (semantic) format.
*/
-void fz_print_stext_page_html(fz_context *ctx, fz_output *out, fz_stext_page *page);
+void fz_print_stext_page_as_xhtml(fz_context *ctx, fz_output *out, fz_stext_page *page);
+void fz_print_stext_header_as_xhtml(fz_context *ctx, fz_output *out);
+void fz_print_stext_trailer_as_xhtml(fz_context *ctx, fz_output *out);
/*
- fz_print_stext_page_xml: Output a page to a file in XML format.
+ fz_print_stext_page_as_xml: Output a page to a file in XML format.
*/
-void fz_print_stext_page_xml(fz_context *ctx, fz_output *out, fz_stext_page *page);
+void fz_print_stext_page_as_xml(fz_context *ctx, fz_output *out, fz_stext_page *page);
/*
- fz_print_stext_page: Output a page to a file in UTF-8 format.
+ fz_print_stext_page_as_text: Output a page to a file in UTF-8 format.
*/
-void fz_print_stext_page(fz_context *ctx, fz_output *out, fz_stext_page *page);
+void fz_print_stext_page_as_text(fz_context *ctx, fz_output *out, fz_stext_page *page);
/*
fz_search_stext_page: Search for occurrence of 'needle' in text page.
diff --git a/include/mupdf/fitz/writer.h b/include/mupdf/fitz/writer.h
index f16334fc..b5121707 100644
--- a/include/mupdf/fitz/writer.h
+++ b/include/mupdf/fitz/writer.h
@@ -83,8 +83,8 @@ int fz_option_eq(const char *a, const char *b);
path: The document name to write (or NULL for default)
- format: Which format to write (currently cbz, pdf, pam, pbm,
- pgm, pkm, png, ppm, pnm, svg, tga)
+ format: Which format to write (currently cbz, html, pdf, pam, pbm,
+ pgm, pkm, png, ppm, pnm, svg, text, tga, xhtml)
options: NULL, or pointer to comma separated string to control
file generation.
@@ -94,6 +94,7 @@ fz_document_writer *fz_new_document_writer(fz_context *ctx, const char *path, co
fz_document_writer *fz_new_cbz_writer(fz_context *ctx, const char *path, const char *options);
fz_document_writer *fz_new_pdf_writer(fz_context *ctx, const char *path, const char *options);
fz_document_writer *fz_new_svg_writer(fz_context *ctx, const char *path, const char *options);
+fz_document_writer *fz_new_text_writer(fz_context *ctx, const char *format, const char *path, const char *options);
fz_document_writer *fz_new_png_pixmap_writer(fz_context *ctx, const char *path, const char *options);
fz_document_writer *fz_new_tga_pixmap_writer(fz_context *ctx, const char *path, const char *options);
fz_document_writer *fz_new_pam_pixmap_writer(fz_context *ctx, const char *path, const char *options);