Hey Saif,
For uploading you could just use the out-of-the-box Upload widget. Then you could build a logic that takes the Binary file and saves it into a table from your database. Afterwards you can just use pdf.js to preview that PDF file in the browser.
Hope this helps,
Bogdan