Take user input(like Roll Now) and submit and get downloadable pdf file in return, is it possible in javascript

i am a beginner and working on a project where user will enter roll number and after clicking submit button… downloadable pdf file should display.