Right Click Is Disabled...

Document Preview.

(For Previewing the Png, Jpg,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 example for Image File.
  • While clicking on JPGPreview.
  • For example for PDF File.
  • While clicking on PDFPreview.
  • For example for WordFile.
  • While clicking on WordPreview.
  • For example for PNGFile.
  • While clicking on PNGPreview.
  • For example for WordFile.
  • While clicking on Word Preview In NewWindow.
  • For example for PDFFile.
  • While clicking on PDFPreview In NewWindow.

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 *