Can we do this via JavaScript in Uppy? The library the ASU/AWS team uses to get page counts is implemented here:
https://github.com/ASUCICREPO/PDF_accessability_UI/blob/main/pdf_ui/src/components/UploadSection.jsx#L139-L143
We should be able to do something similar, and send the count back to the ruby app on page submit to store with the Job in the database.
Also, I think we can pass the file size along during signing, and block the presigned url from generating if the user exceeds their limit. I haven't dug deeply enough into our code yet to confirm this, though.