How to add a PDF download link to your View

In this article, you will learn how to add a PDF download link to your View, allowing users to download individual entries as PDFs.

1. Installing GravityExport (required)

You'll need to start by installing GravityExport. You can do this from the "Products & Licenses" page under the "GravityKit" menu item in WordPress. GravityExport is our plugin that allows you to export Gravity Forms entries to CSV, Excel or PDF using a secure download URL. GravityExport plugin icon

After activating GravityExport, you'll need to create a new export feed and enable the download URL.

2. Creating a new export feed

Locate the form that's attached to your View and go to the form settings page. Now, click on "GravityExport Lite" and enable the download.

The Enable Download button on the GravityExport feed pageNow set the report file extension to ".pdf".

the pdf file extension option in the file extenion drop down field

Make sure you configure the remaining options and save the feed. After that, scroll up and copy the download URL.

The PDF download URL generated by GravityExportThe next step is to construct the PDF download link and add it to a View.

3. Adding the PDF download link to your View

Now edit your View in GravityView and add a Custom Content field where you want the download link to show up. You can do this by clicking on the "Add Field" button and selecting "Custom Content".

The gravityview custom content field

Open the Custom Content text editor by clicking on the gear icon. Inside the editor, add an HTML anchor link using the download URL you generated in the previous step. Just make sure to add ?entry={entry_id} to the end of the URL. 

a HTML anchor link inside a GravityView Custom Content field

When you're done, simply save your View and check it out on the front end.

A Download PDF button inside a View in GravityView

That's it! 

If you want to create an attractive button, you'll need to add a class and custom styles. Here is some code you can use to achieve the above look (just make sure to replace the download URL with your own!):

<a class="button-pdf" href="https://testing.try.gravitykit.com/gf-entries-in-excel/0bcbb585fbd250ab94af7e0796c5d7b0c31df4eeb284c48f6632cd3dfec148c8?entry={entry_id}">Download as PDF</a>

<style>
.button-pdf {
padding: 20px 10px;
color: #fff;
background-color: #808080;
border-radius: 9px;
box-shadow: 0px 2px 3px rgba(19, 126, 180, .30);
padding: 15px 32px;
 display: inline-block;
 font-size: 18px;
text-align: center;
text-decoration:none; 
}
	
.button-pdf:hover {
color:#ffffff;
background-color: #595959;
		
}
</style>
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us