diff options
author | Paul Gardiner <paul@glidos.net> | 2012-05-28 13:51:30 +0100 |
---|---|---|
committer | Paul Gardiner <paul@glidos.net> | 2012-05-28 13:51:30 +0100 |
commit | 741fe4a4d7bbd6ee914504be7e85356a741601c4 (patch) | |
tree | c25f6f4ea0d06c97fe4b021571a7a897eef856f5 /pdf/pdf_jsimp_cpp.c | |
parent | fa5ee3a96cb4cb184cf6cc807a67632666b936bf (diff) | |
download | mupdf-741fe4a4d7bbd6ee914504be7e85356a741601c4.tar.xz |
Forms: implement JavaScript Field methods setFillColor and setTextColor
Diffstat (limited to 'pdf/pdf_jsimp_cpp.c')
-rw-r--r-- | pdf/pdf_jsimp_cpp.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pdf/pdf_jsimp_cpp.c b/pdf/pdf_jsimp_cpp.c index 1e98d680..3457ee5b 100644 --- a/pdf/pdf_jsimp_cpp.c +++ b/pdf/pdf_jsimp_cpp.c @@ -103,6 +103,36 @@ char *pdf_jsimp_toString(pdf_jsimp *imp, pdf_jsimp_obj *obj) return str; } +double pdf_jsimp_toNumber(pdf_jsimp *imp, pdf_jsimp_obj *obj) +{ + double num; + char *err = pdf_jsimp_toNumber_cpp(imp, obj, &num); + if (err != NULL) + fz_throw(pdf_jsimp_ctx_cpp(imp), "%s", err); + + return num; +} + +int pdf_jsimp_array_len(pdf_jsimp *imp, pdf_jsimp_obj *obj) +{ + int len = 0; + char *err = pdf_jsimp_array_len_cpp(imp, obj, &len); + if (err != NULL) + fz_throw(pdf_jsimp_ctx_cpp(imp), "%s", err); + + return len; +} + +pdf_jsimp_obj *pdf_jsimp_array_item(pdf_jsimp *imp, pdf_jsimp_obj *obj, int i) +{ + pdf_jsimp_obj *item = NULL; + char *err = pdf_jsimp_array_item_cpp(imp, obj, i, &item); + if (err != NULL) + fz_throw(pdf_jsimp_ctx_cpp(imp), "%s", err); + + return item; +} + void pdf_jsimp_execute(pdf_jsimp *imp, char *code) { char *err = pdf_jsimp_execute_cpp(imp, code); |