0

I have a form that, upon submission, should redirect and display a PDF from my media library. Upon submission, I am receiving this error:

enter image description here

Does Sitecore 9 Forms require that I provide a layout file for presenting PDFs?

  • 1
    No. I think you need to specify the pdf extension in the url: .pdf because Sitecore thinks it is an item with a layout that you want to render. Use the GetMediaUrl() to generate the url for the pdf and then perform the redirection – Hishaam Namooya Apr 13 '18 at 20:13
  • Thank you - the GetMediaUrl() was very helpful; however, the PDF is not being opened in the current window, it is instead being downloaded by the browser - how do I supersede this? – MmKk Apr 18 '18 at 14:10
  • 1
    It is another question and you can check the link sitecore.stackexchange.com/questions/6046/…. So i will post the comment as an answer since this is what was the question – Hishaam Namooya Apr 18 '18 at 14:13
2

In order to have the proper url for the .pdf, you need to use the method GetMediaUrl.

This will generates the url in the proper way. Moreover, you can check the following answer on how to open or display the pdf on the browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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