Support for create widget #124
Replies: 4 comments 1 reply
-
@conor-mac-aoidh I think this is an oversight in the docs - you should be able to do: API for a Thanks for noticing this - we will update the docs. |
Beta Was this translation helpful? Give feedback.
-
Thank you for clarifying. I also see a I was able to create a widget with Some additional questions.
![]() |
Beta Was this translation helpful? Give feedback.
-
Thanks for this info. I've been looking more into our state-of-play here a bit more. The Widget support is very much work in progress and from looking at line 3587 here: https://github.com/ArtifexSoftware/mupdf.js/blob/master/src/mupdf.ts I can see there are a few TODOs around interactivity which need to be resolved. Right now I don't believe you can set a field type. So although we have some form of Widget support I would say it is very much read only. By the way, I'm confused when you say that the annotations-test example creates a widget, all I see in that example is the reading widgets info from a loaded PDF. Can you clarify? In summary we want to reach this kind of benchmark in the short term: https://pymupdf.readthedocs.io/en/latest/widget.html#supported-widget-types However, at present, I'm realising that we are probably right at present to state that Widget creation is not supported in MuPDF.js (because it is not fully functional) and the current documentation is in this sense "correct". There is much more to do here so I would recommend watching the repo for further developments and definitely to find MuPDF.js on Discord to keep in touch with what is going on ( and to nudge us :) ). In terms of the ongoing development, the approach here will be to:
In this way I hope a usable interface can be presented for widgets. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your detailed reply. I will have a go at using the top-level API. Also I'll join the discord when I return in January :)
Apologies for the confusion, I meant that the annotation-test renders the text widget with the value "3", but it cannot be edited. |
Beta Was this translation helpful? Give feedback.
-
I would like to create form fields (a.k.a. Widgets) with muPDF in JS. Looking at the API docs (
PDFPage.createAnnotation
), this does not appear to be possible. However, it is possible in the C library and in PyMuPDF.What would be involved in adding support for this in mupdf.js ?
Beta Was this translation helpful? Give feedback.
All reactions