Update ui.js

No clue if this works, but a proposed pdf generator