summaryrefslogtreecommitdiff
path: root/source/fitz/writer.c
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 /source/fitz/writer.c
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 'source/fitz/writer.c')
-rw-r--r--source/fitz/writer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/fitz/writer.c b/source/fitz/writer.c
index cd71329a..4e436e08 100644
--- a/source/fitz/writer.c
+++ b/source/fitz/writer.c
@@ -140,6 +140,15 @@ fz_new_document_writer(fz_context *ctx, const char *path, const char *format, co
if (!fz_strcasecmp(format, "pkm"))
return fz_new_pkm_pixmap_writer(ctx, path, options);
+ if (!fz_strcasecmp(format, "txt") || !fz_strcasecmp(format, "text"))
+ return fz_new_text_writer(ctx, "text", path, options);
+ if (!fz_strcasecmp(format, "html"))
+ return fz_new_text_writer(ctx, format, path, options);
+ if (!fz_strcasecmp(format, "xhtml"))
+ return fz_new_text_writer(ctx, format, path, options);
+ if (!fz_strcasecmp(format, "stext"))
+ return fz_new_text_writer(ctx, format, path, options);
+
fz_throw(ctx, FZ_ERROR_GENERIC, "unknown output document format: %s", format);
}