Made the document viewer responsive

Addresses #3421