From 2bd952f3fa8241aad0626f39343cffa9855c2d8c Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 12 Mar 2012 15:57:28 +0000 Subject: 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. --- apps/mupdfextract.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'apps/mupdfextract.c') 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) -- cgit v1.2.3