farling42 / fvtt-pdf-pager

PDF Pager for Foundry
MIT License
6 stars 4 forks source link

Dropdown Menu Bug? #82

Closed strlys closed 3 months ago

strlys commented 7 months ago

I’m using a Mr. Gone’s Vampire 3rd edition PDF character sheet (here's the download link), and replacing the character sheet from the WoD v20 system.

So, even when I check the PDF Pager option "Read Fields from PDF", some fields are not read and displayed. In my case, 'dropdown menu fields' are not displayed and are basically blank. This only happens if I write something other than one of the dropdown menu choices, and PDF Pager does not give me the ability to write my own text in these fields, even when I don't have the "Read Fields from PDF" checked.

Here's some demonstration:

Original PDF: image

PDF Pager: image

Am I doing something wrong, or this is a bug?

Thanks for the awesome module, and I hope you can help me with this!

farling42 commented 7 months ago

Thanks for the download link. I will need to investigate how the drop-down boxes that also allow manual text input work.

farling42 commented 6 months ago

Not being able to enter text into the boxes which also provide an optional drop-down menu is a limitation in the pdfjs library which is shipped with Foundry. There's nothing I can do in PDF Foundry to fix this issue.

Technical details (mostly for myself): pdf.js creates a "select" element, but it should really create a "input text" element with an associated datalist to get this functionality working properly (in annotation_layer.js:ChoiceWidgetAnnotationElement.render) The code does not test for hasFieldFlag(AnnotationFieldFlag.EDIT which would indicate that "custom text" can be entered. Sample input+datalist example can be found at https://stackoverflow.com/questions/5650457/html-select-form-with-option-to-enter-custom-value

farling42 commented 6 months ago

This is a known issue with pdf.js, it was originally raised 5 years ago: https://github.com/mozilla/pdf.js/issues/10669