Try our conversational search powered by Generative AI!

How to display a pdf in a new window after submission?

Vote:
 

Hi guys, 

I would like to use Epiform as a download file form. A pdf file will be displayed after submission.

My question is, is it able to open the pdf file in a new window? Does it need to customize the form?

Thanks! 

#197161
Edited, Sep 25, 2018 9:40
Vote:
 

It sounds like you want a gated download following a form submission.

I recommend that you

  1. create the form to capture the information that you want
  2. create a visitor group that checks that your new form has been submitted
    • Make sure that you enable the visitor group as a security role before you save it
  3. upload the PDF, and set permissions so that only your new visitor group has read rights (i.e. not "everyone")
  4. edit your form again, so that on submit you redirect to a page that either is a shortcut to the PDF or has a link on it to the PDF.
#197163
Sep 25, 2018 11:16
Vote:
 

Hi Marcus! Thanks for the tips!

I would like to something like this, when the visitor clicks the download button, a pdf will open in a new tab/window.

I will try to add the built-in episerver form visitor group criteria in code, I found this https://github.com/episerver/EPiServer.Forms.Samples/tree/master/Criteria.

#197165
Edited, Sep 25, 2018 12:51
Vote:
 

Apologies, I misunderstood what you were trying to achieve.

If you simply want a download button, you could simply create a 'button' BlockType that has various properties for colour, text, etc.; that also contains a ContentReference property and a checkbox (boolean) for "Open in new window".

When you create a new button of that type, use the ContentReference property to point to the PDF, and in the view construct the button and link. If the "Open in new window" value on the block is true, then include the target="_blank" in the link.

You can also configure theis type of link in the RTE too if you need that.

#197189
Sep 26, 2018 2:50
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.