Hi there,
Since Netlify’s functions only support Go and Javascript (separately), I don’t think that there is a Java runtime available in them. Further our functions have a small memory limit and runtime and so even the act of sending two large PDF’s may overrun the timer there (10 seconds by default), not giving your code time to do the work.
I could be wrong; I’ve never used a javascript module that required java in our functions but I may be wrong about that if you want to try! If I’m not wrong, then you’re better off using some other service like heroku to host that piece of your backend (we can still proxy to it, or you could send off an API request to it once files are input by your visitor)