Can anyone tell me the correct methodology to getting modal popups to work with PDF files in a document library on SharePoint 2013?


1 Answer 1


When creating the modal dialog, in the options just try setting the URL to the location to the PDF file. I haven't tried this myself with a PDF file but it should work:

var options = {
    title: "Modal title",
    url: "/site/documentlibrary/document.pdf",

SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
  • Your solution only appears to be for one file, the document library contains hundreds of PDF files.
    – surfnode
    Commented May 23, 2016 at 9:29
  • Please be clearer in your question. What is it you are trying to achieve exactly? What's the use case? When a user clicks a PDF in a document library a modal should pop up displaying that PDF?
    – Submits
    Commented May 23, 2016 at 10:31
  • Yes thats correct and this should apple to all PDFs.
    – surfnode
    Commented May 26, 2016 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.