Gravity PDF setup guide

Gravity PDF setup guide

Here is a quick guide on how to setup our Gravity PDF integration add-on (still in beta) and generate beautiful charts inside the PDF attached in email notifications. You can quickly test it here.

0 – Install PhantomJS on your server

At the moment, it is not possible to embed PhantomJS inside the plugin, so you have to make sure it is installed on your server. We are working hard to make this step useless in a near futur. For instance, install PhantomJS on Ubuntu 16.

1 – Install plugins

Make sure you have installed and activated both plugins:

Upload

MaxiCharts Gravity PDF add-on is quite a big zip file, and most web servers configurations won’t let you upload such a big file through your WordPress backend plugin upload form. You will then need either to

  • increase upload_max_filesize value inside php.ini file, if you have access to it
  • use a dedicated plugin to allow upload of very big plugins
  • else you need to upload this zip file manually using an FTP client (we recommand free FileZilla client) to the /wp-content/plugins directory on your web server.

Install on server

  1. Unzip the plugin files.
  2. All plugins downloaded from the Plugin Directory are in the Zip format. Most operating systems (Windows, Mac, and so on) have built-in tools to open Zip files. After opening the Zip file, extract the directory contained inside the Zip file and put it in a directory on your computer that is easily accessible.
  3. Connect to your site’s server using FTP.
  4. If you have any difficulty connecting to your server, contact your hosting provider and ask for assistance in connecting to your server via FTP.
  5. Navigate to the wp-content folder within the WordPress installation for your website or blog.
  6. The location of your WordPress installation can differ with every hosting provider. Make sure that you know the location before you proceed.
  7. Navigate to the /wp-content/plugins directory.
  8. First, navigate to wp-content. Inside this directory are the plugins and themes directories along with a few others. Navigate to the plugins directory. It is inside this directory that all plugins reside.
  9. Upload the plugin folder to the /wp-content/plugins directory on your web server. This may take a while as the plugin contains quite a lot of files
  10. The plugin folder, named for the plugin (for example, the folder is /maxicharts-pdf-add-on here) contains all the files for that plugin.
  11. Go to the Dashboard’s Plugins page and you see the new plugin listed. If a mistake is made, delete all the newly uploaded files and begin again.
  12. Activate the plugin

Check server permissions

Make sure the whole plugin directory is owned by the web server user, for example with Apache on Ubuntu:
chown -R www-data:www-data maxicharts-pdf-add-on/
Make also sure that casperjs is executable by launching the command:
chmod +x maxicharts-pdf-add-on/node_modules/casperjs/bin/*

2 – Create a Gravity form or modify an existing one

3 – Insert a hidden (or text) field and set its value to a MaxiCharts shortcode

What’s great is that you can insert any MaxiCharts shortcode, even one charting another form entries 🙂

Create field

Create a field (text or hidden) dedicated to receive MaxiCharts shortcode.
Create a field (text or hidden) dedicated to receive MaxiCharts shortcode.

Set shortcode as Default Value

Set the shortcode you want as the Default Value.
Set the shortcode you want as the Default Value.

4 – Enable at least one notification

in order for the plugin to attach the PDF file of the form with the chart you need

5 – Enable at least one PDF

And do not forget to associate it with the notification of your choice. See Gravity PDF documentation for further explanations.

That’s all!

Include your Gravity form as you would for any form in any post or page and you are ready to go !

About The Author

Comments (10)

  • david1

    Hi. Just installed this and it breaks our site (sure it’s a template thing as it works with the general WordPress themes but none of the premium ones Ive tested). The chart doesn’t print into the PDF, only the shortcode. It would be great to see if we can get this working. Happy to send over any details that you need.

    D

    • MaxiCharts

      Thanks a lot for your feedback, can you please send the log file located under maxicharts/logs/

    • MaxiCharts

      Please use the contact form for this

  • safehouse.au

    I’m getting “No data from data source gf” in the HTML (got an X image on PDF). The same shortcode on a page displays the charts fine.

    2019-03-27 03:37:41,683 GF INFO ***/wp-content/plugins/maxicharts-gravity-forms-source-add-on/mcharts_gf_source_add_on.php:1397 Process source gf
    2019-03-27 03:37:41,684 GF INFO ***/wp-content/plugins/maxicharts-gravity-forms-source-add-on/mcharts_gf_source_add_on.php:1533 Get DATAS from GF source gf
    2019-03-27 03:37:41,684 GF INFO ***/wp-content/plugins/maxicharts-gravity-forms-source-add-on/mcharts_gf_source_add_on.php:1663 maxicharts_gravity_forms returns 0 report fields
    2019-03-27 03:37:41,685 MAXICHARTS WARN ***/wp-content/plugins/maxicharts/maxicharts.php:750 No data from data source gf

    Kindly assist

    • MaxiCharts

      Hi,

      The shortcode inside the PDF will work exactly the same as on a wordpress page, so please first test your shortcode as usual on any post or page. If it says “No data from data source gf”, it means it cannot find any data matching your shortcode parameters, can you please provide a link to the page and the shortcode used ? Cheers

  • safehouse.au

    Thanks again.

    Could I confirm that PhantomJS is a must-install for this to work?

    I have a dev server with PhantomJS installed and am getting the same issue as David1 (shortcode printed on PDF) and another test server without PhantomJS but with an X on the PDF. Both shortcodes work on normal embed pages.

    • MaxiCharts

      Ok thanks for your feedback safehouse, the X you can see confirms the image of the chart has not been created at all : probably PhantomJs not installed, you are right.
      If the shortcode stays the same (not interpreted), that’s different, can you confirm the plugin is installed and activated ? Else please run the test and send us you log file via the contact form : https://maxicharts.com/change-maxicharts-log-level/

      • safehouse.au

        Yes, I can confirm all 3 plugins are installed and activated. I will do another test PDF on the staging site with PhantomJS installed with the log on debug mode, and send that across. This would be a great tool if PhantomJS wasn’t required though!

        • MaxiCharts

          Ok, yes phantomjs is required on the server at the moment but won’t be in the future. Thanks for your feedback.

Leave Comment