For PDF you can use ViewerJs and embed in a frame....