diff options
Diffstat (limited to 'pdf/pdf_cmap_load.c')
-rw-r--r-- | pdf/pdf_cmap_load.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/pdf/pdf_cmap_load.c b/pdf/pdf_cmap_load.c index 3257516c..8ab7e646 100644 --- a/pdf/pdf_cmap_load.c +++ b/pdf/pdf_cmap_load.c @@ -1,5 +1,5 @@ -#include "fitz.h" -#include "mupdf.h" +#include "fitz-internal.h" +#include "mupdf-internal.h" unsigned int pdf_cmap_size(fz_context *ctx, pdf_cmap *cmap) @@ -16,13 +16,13 @@ pdf_cmap_size(fz_context *ctx, pdf_cmap *cmap) * Load CMap stream in PDF file */ pdf_cmap * -pdf_load_embedded_cmap(pdf_document *xref, fz_obj *stmobj) +pdf_load_embedded_cmap(pdf_document *xref, pdf_obj *stmobj) { fz_stream *file = NULL; pdf_cmap *cmap = NULL; pdf_cmap *usecmap; - fz_obj *wmode; - fz_obj *obj = NULL; + pdf_obj *wmode; + pdf_obj *obj = NULL; fz_context *ctx = xref->ctx; int phase = 0; @@ -31,31 +31,31 @@ pdf_load_embedded_cmap(pdf_document *xref, fz_obj *stmobj) fz_var(file); fz_var(cmap); - if ((cmap = fz_find_item(ctx, pdf_free_cmap_imp, stmobj))) + if ((cmap = pdf_find_item(ctx, pdf_free_cmap_imp, stmobj))) { return cmap; } fz_try(ctx) { - file = pdf_open_stream(xref, fz_to_num(stmobj), fz_to_gen(stmobj)); + file = pdf_open_stream(xref, pdf_to_num(stmobj), pdf_to_gen(stmobj)); phase = 1; cmap = pdf_load_cmap(ctx, file); phase = 2; fz_close(file); file = NULL; - wmode = fz_dict_gets(stmobj, "WMode"); - if (fz_is_int(wmode)) - pdf_set_wmode(ctx, cmap, fz_to_int(wmode)); - obj = fz_dict_gets(stmobj, "UseCMap"); - if (fz_is_name(obj)) + wmode = pdf_dict_gets(stmobj, "WMode"); + if (pdf_is_int(wmode)) + pdf_set_cmap_wmode(ctx, cmap, pdf_to_int(wmode)); + obj = pdf_dict_gets(stmobj, "UseCMap"); + if (pdf_is_name(obj)) { - usecmap = pdf_load_system_cmap(ctx, fz_to_name(obj)); + usecmap = pdf_load_system_cmap(ctx, pdf_to_name(obj)); pdf_set_usecmap(ctx, cmap, usecmap); pdf_drop_cmap(ctx, usecmap); } - else if (fz_is_indirect(obj)) + else if (pdf_is_indirect(obj)) { phase = 3; usecmap = pdf_load_embedded_cmap(xref, obj); @@ -63,7 +63,7 @@ pdf_load_embedded_cmap(pdf_document *xref, fz_obj *stmobj) pdf_drop_cmap(ctx, usecmap); } - fz_store_item(ctx, stmobj, cmap, pdf_cmap_size(ctx, cmap)); + pdf_store_item(ctx, stmobj, cmap, pdf_cmap_size(ctx, cmap)); } fz_catch(ctx) { @@ -72,13 +72,13 @@ pdf_load_embedded_cmap(pdf_document *xref, fz_obj *stmobj) if (cmap) pdf_drop_cmap(ctx, cmap); if (phase < 1) - fz_throw(ctx, "cannot open cmap stream (%d %d R)", fz_to_num(stmobj), fz_to_gen(stmobj)); + fz_throw(ctx, "cannot open cmap stream (%d %d R)", pdf_to_num(stmobj), pdf_to_gen(stmobj)); else if (phase < 2) - fz_throw(ctx, "cannot parse cmap stream (%d %d R)", fz_to_num(stmobj), fz_to_gen(stmobj)); + fz_throw(ctx, "cannot parse cmap stream (%d %d R)", pdf_to_num(stmobj), pdf_to_gen(stmobj)); else if (phase < 3) - fz_throw(ctx, "cannot load system usecmap '%s'", fz_to_name(obj)); + fz_throw(ctx, "cannot load system usecmap '%s'", pdf_to_name(obj)); else - fz_throw(ctx, "cannot load embedded usecmap (%d %d R)", fz_to_num(obj), fz_to_gen(obj)); + fz_throw(ctx, "cannot load embedded usecmap (%d %d R)", pdf_to_num(obj), pdf_to_gen(obj)); } return cmap; @@ -97,7 +97,7 @@ pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes) pdf_add_codespace(ctx, cmap, 0x0000, 0xffff, bytes); pdf_map_range_to_range(ctx, cmap, 0x0000, 0xffff, 0); pdf_sort_cmap(ctx, cmap); - pdf_set_wmode(ctx, cmap, wmode); + pdf_set_cmap_wmode(ctx, cmap, wmode); } fz_catch(ctx) { |