Right Click Is Disabled...

Document Preview

(For Previewing the PNG, JPEG,PDF, and DOCX) File Directly on the page, without Downloading it.

 In this project, document can be previewed in the current tab, new tab as well as new window on a click of a link.

You can use the same link for all preview method or you can change the link.

Just you need to make the perfect URL with the website name then folder name then file name that’s all, and it is done your preview for the document will work fine.

For example :

string websitePath = "https://xtremethoughts.com/";
string LocationPath = "Documents/";
string fileName = "VivekDocumentPreview.pdf";

It will make the perfect URL, which can be used to view the File.

For the example of Image File. While clicking on JPEG preview.

For the example of PDF File. While clicking on PDF preview.

For the example of Word File. While clicking on Word preview.

For the example of PNG File. While clicking on PNG preview.

For the example of Word File. While clicking on Word preview in new window.

For the example of PDF File. While clicking on PDF preview in new window.

Source code

Source code for this sample is available on GitHub at github.com/vjvivekjaiswal1998/DocumentPreview

Share On

Leave a Comment

Your email address will not be published. Required fields are marked *