summaryrefslogtreecommitdiff
path: root/apps/mupdfextract.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-03-12 15:57:28 +0000
committerRobin Watts <robin.watts@artifex.com>2012-03-12 15:57:28 +0000
commit2bd952f3fa8241aad0626f39343cffa9855c2d8c (patch)
tree002167e3d4bf0301fd53be96a3324fd9ed48936d /apps/mupdfextract.c
parente49c70808fba2d0d2a691d1568d766bfeee863f0 (diff)
downloadmupdf-2bd952f3fa8241aad0626f39343cffa9855c2d8c.tar.xz
More API work.
Details of buffers hidden in fitz-internal.h. Public API now just lets us keep/drop and get storage details for a buffer. fz_debug_outline{,_xml} lose the 'level' param in their public API. fz_matrix_max_expansion hidden, as it's only used internally. Document fz_setjmp/fz_longjmp and Apple specific hackery.
Diffstat (limited to 'apps/mupdfextract.c')
-rw-r--r--apps/mupdfextract.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/mupdfextract.c b/apps/mupdfextract.c
index 1f53541b..398ff6d9 100644
--- a/apps/mupdfextract.c
+++ b/apps/mupdfextract.c
@@ -60,7 +60,8 @@ static void savefont(pdf_obj *dict, int num)
char *ext = "";
FILE *f;
char *fontname = "font";
- int n;
+ int n, len;
+ char *data;
obj = pdf_dict_gets(dict, "FontName");
if (obj)
@@ -113,8 +114,9 @@ static void savefont(pdf_obj *dict, int num)
if (!f)
fz_throw(ctx, "Error creating font file");
- n = fwrite(buf->data, 1, buf->len, f);
- if (n < buf->len)
+ len = fz_buffer_storage(ctx, buf, &data);
+ n = fwrite(data, 1, len, f);
+ if (n < len)
fz_throw(ctx, "Error writing font file");
if (fclose(f) < 0)