Integration with Gravity PDF

How do I get the selected image to display in my Gravity PDF template

By default Gravity PDF will display the selected choice text or value. The image is stored as a custom value on the choice, separate to the text and value, but you can use one of Gravity PDF’s filters to get the image to display. Firstly, make sure that your Image Choices setting for “Default Entry / Notification Display” is set to an image-based option. Either “Image“, “Image and Label” or “Image and Value“, whichever suits your needs.

Note this setting is found within the form Settings and the Image Choices tab. So it needs to be set per form. You can also optionally override this setting for specific fields when editing your form, in the field Appearance tab.

Gravity PDF Filters

There are two Gravity PDF filters. Which one you use will depend on the field type. For normal radio button or checkbox fields you can use the gfpdf_pdf_field_content filter. The following example demonstrates this:

For normal image choices fields

If your field is a Product or Option field, you can use gfpdf_field_product_value filter. The following example demonstrates this:

For Product / Option fields

You can change the $image_width value to the width (in px) you want the image in your PDF. The above examples would include the image. How it looks exactly would depend on which PDF template you’re using and the styles it has.

The great thing about Gravity PDF is you can customize templates or roll your own, and implement extra custom styles that way. For help with Gravity PDF templates please contact their support.