-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
However, since Firefox's PDF viewer, PDF.js, ultimately displays documents as HTML & CSS, you could fairly easily set up some custom CSS to apply an invert filter - this would turn black-text-on-white-pages to white-text-on-black-pages. Paired with a hue-rotate filter, you can get a decent dark mode with fairly accurate colours with next to no effort. The trick would be applying it only to pages that are too 'bright' - perhaps that could be done in JS. If you really dug into it, you could probably have a look at how the Dark Reader browser extension handles automatically darkening websites it doesn't doesn't have rules for.