From 3781cd9690a18be7a1ded9bb9f0263164b5a80cf Mon Sep 17 00:00:00 2001 From: "Jorj X. McKie" Date: Fri, 4 Aug 2023 06:25:10 -0400 Subject: [PATCH] Use low-level function for name objects "Bl" and "Fo" MuPDF does not yet have predefined name objects for "Bl" and "Fo", so we need to make them on the fly. --- fitz/helper-fields.i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fitz/helper-fields.i b/fitz/helper-fields.i index 1fa087317..3a6805a62 100644 --- a/fitz/helper-fields.i +++ b/fitz/helper-fields.i @@ -586,7 +586,7 @@ void JM_get_widget_properties(fz_context *ctx, pdf_annot *annot, PyObject *Widge JM_get_script(ctx, pdf_dict_getl(ctx, annot_obj, PDF_NAME(AA), pdf_new_name(ctx, "Bl"), NULL))); SETATTR_DROP(Widget, "script_focus", - JM_get_script(ctx, pdf_dict_getl(ctx, annot_obj, PDF_NAME(AA), PDF_NAME(Fo), NULL))); + JM_get_script(ctx, pdf_dict_getl(ctx, annot_obj, PDF_NAME(AA), pdf_new_name(ctx, "Fo"), NULL))); } fz_always(ctx) PyErr_Clear(); fz_catch(ctx) fz_rethrow(ctx); @@ -801,7 +801,7 @@ void JM_set_widget_properties(fz_context *ctx, pdf_annot *annot, PyObject *Widge // script (/AA/Fo) ------------------------------------------------------ value = GETATTR("script_focus"); - JM_put_script(ctx, annot_obj, PDF_NAME(AA), PDF_NAME(Fo), value); + JM_put_script(ctx, annot_obj, PDF_NAME(AA), pdf_new_name(ctx, "Fo"), value); Py_CLEAR(value); // field value ------------------------------------------------------------