Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using Gravity Forms.

Overview

Gravity PDF

codecov

Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using the popular form-builder plugin, Gravity Forms (affiliate link). Find out more about Gravity PDF at https://gravitypdf.com.

About

This Git repository is for developers who want to contribute to Gravity PDF. Don't use it in production. For production use, download Gravity PDF from the WordPress Plugin Directory.

The development branch is considered our bleeding edge branch, with all new changes pushed to it. The master branch is our latest stable version of Gravity PDF.

Installation

Prerequisites

Setup for Docker

The Docker setup will create a fully functionality development environment preconfigured for Gravity PDF.

  1. Clone the repository using git clone https://github.com/GravityPDF/gravity-pdf/ from the terminal
  2. Copy and rename .env.example to .env, then replace 00000000000000000000000000000000 with a valid Gravity Forms license key
  3. Run yarn prebuild and yarn build:production
  4. Start Docker Desktop (or run docker-machine start && eval $(docker-machine env) if using Docker Toolbox)
  5. Run yarn env:install, then wait for the Docker environment to start-up
  6. If successful, you will now have a fully-functional development environment setup with Gravity Forms and Gravity PDF. The URL and login details will be shown in the terminal.

If you shutdown Docker and want to fire up the environment later, use yarn env start. You can also reset the database back to its original state with yarn env:reset.

Enable X-Debug

For Windows users:

To enable X-Debug in the containers. You need to set the environmental variables before starting up Docker:

  • export LOCAL_PHP_XDEBUG=true
  • If running Docker Toolbox you'll need to manually set the host IP address: export XDEBUG_HOST_IP=10.0.0.1 NOTE: Change the IP 10.0.0.1 to the value of$_SERVER['REMOTE_ADDR'] when you load up the Docker-powered site.

If you’ve brought up the containers already, run yarn env stop and yarn env start to reboot after setting the variable.

For Linux users:

Run the command ip a and find the docker0 network interface. Copy the inet value. e.g. inet 172.17.0.1/16, and then include these variables when you start your docker machine.

  • e.g LOCAL_PHP_XDEBUG=true XDEBUG_HOST_IP=172.17.0.1 yarn env start.

When you do your Path Mappings in your IDE, make sure to name your server localhost to do CLI debugging (including PHPUnit via yarn test:php).

  • NOTE: Set the server path mapping to the following:
  • /path/to/gravity-pdf/folder/* => /var/www/src/wp-content/plugins/gravity-forms-pdf-extended
  • /path/to/gravity-pdf/folder/wordpress/ => var/www

Switch PHP Versions

By default, the latest stable version of PHP will be used when you start the Docker environment. To switch, set the environmental variable LOCAL_PHP to one of the following:

  • 7.3-fpm
  • 7.4-fpm

For example, to swap to PHP 7.4 run export LOCAL_PHP=7.4-fpm and then stop and start your container with yarn env stop and yarn env start.

Setup without Docker

If you would rather use your own development environment, you can build Gravity PDF using the following commands.

  1. Clone the repository using git clone https://github.com/GravityPDF/gravity-pdf/
  2. Run yarn prebuild and yarn build:production
  3. Run composer install
  4. Run bash ./bin/vendor-prefix.sh

Linting

To lint your JS code, use yarn lint:js.

To lint your PHP code with Docker use:

yarn env docker-run php composer compat
yarn env docker-run php composer lint
yarn env docker-run php composer lint:errors

To automatically fix PHP lint errors, use yarn env docker-run php composer format

If you aren't using docker, omit yarn env docker-run php from the beginning of each command.

Automated Tests

The automated test suite can only be run using Docker.

E2E

Useful commands include:

yarn test:e2e
yarn test:e2e:headless

PHPUnit

To successfully run all PHPUnit tests you will need an Elite Gravity Forms license so the Survey, Poll, and Quiz plugins can be automatically installed and downloaded. To install these plugins, run yarn env:install:phpunit.

You can then run full suite of tests using yarn test:php or yarn test:php:multisite

JavaScript

The JavaScript unit tests can be run with yarn test:js

Building JS

If you are making changes to any of the JavaScript or CSS, run yarn build:watch:js or yarn build:watch:css respectively to ensure the files automatically gets built when you make changes on the file system.

Documentation

All documentation can be found at https://gravitypdf.com/documentation/.

Contributions

You are more than welcome to contribute to Gravity PDF but we recommend you open a new issue on GitHub and discuss your use-case before creating a pull request.

There are a few guidelines that need to be followed to ensure a smooth pull request. These include:

  1. Adhere to the existing code standard which follows WordPress standards, with the exception of Yoda conditionals.
  2. All PRs must be to the development branch.
  3. Modifications of the existing codebase must pass unit tests.
  4. Additions to the plugin must have appropriate E2E/unit tests written.
  5. PRs that don't pass existing unit testing or do not have the proper tests to accompany the changes will not be merged.

If you are uncertain whether your PR meets all these requirements, don't worry! If there are problems our friendly team will guide you in the right direction.

Comments
  • PDF List - Download Shortcode

    PDF List - Download Shortcode

    Description We need a more intuitive presentation for this boxes.

    Step To Reproduce Steps to reproduce the behavior:

    1. Go to 'Forms -> Create / Select A form'
    2. Click on 'PDF '
    3. Scroll down to 'PDF List'
    4. See error

    Expected behavior We can strip the borders and background so it would stand as a standard input box. image Optional : Add a message like the system status. image

    Screenshots If applicable, add screenshots to help explain your problem. image

    Bug Frontend 
    opened by jestonihpi 25
  • Add End to End testing with Test Cafe

    Add End to End testing with Test Cafe

    Description

    Issue: #915 Test all our UI components to ensure consistency when making changes.

    Testing instructions

    1. Start Docker. Note: if running Local By Flywheel, first run docker-machine start, then docker-machine env and run the command that gets spit out to configure your shell e.g eval $(docker-machine env).
    2. Copy .env.example to .env and replace 0000000000000000 with a valid Elite license key in .env
    3. Run ./bin/setup-local-env.sh from the command line
    4. Run yarn run test:e2e / yarn run test:e2e:headless

    Checklist:

    • [x] I've tested the code.
    • [x] My code is easy to read, follow, and understand
    • [x] My code follows the accessibility standards.
    • [x] My code has proper inline documentation / docblocks.
    opened by debbieellis7 15
  • Exclude some element without css

    Exclude some element without css

    Hello to Australia from Czech republic, How can I exclude some element from pdf? When I put css "exclude", it works fine, but how exclude element without css possibility, like here: https://gravitywiz.com/documentation/gravity-forms-unique-id/ There is not possible css, so mayby put somthing to function.php?

    opened by StudioOsiris 15
  • Filter Notification messages exclusively to Gravity PDF pages.

    Filter Notification messages exclusively to Gravity PDF pages.

    Create a separate method that returns our errors and notices messages exclusively to Gravity PDF pages.

    NOTE: This may need some improvements on how to properly initialize the Helper_Notice class exclusively to Gravity PDF pages as well.

    Description

    Testing instructions

    Install Gravity Forms Akismet Add-On. Its default error message should not display on PDF settings.

    Screenshots

    Checklist:

    • [x] I've tested the code.
    • [ ] My code is easy to read, follow, and understand
    • [ ] My code follows the accessibility standards.
    • [ ] My code has proper inline documentation / docblocks.

    Additional Comments

    opened by jestonihpi 11
  • Add option to change Nested Form layout in Core templates

    Add option to change Nested Form layout in Core templates

    Enough people have asked, so it's worth giving users the option to show a summary table or all nested form fields.

    Working sample:

    // Gravity PDF Nested Forms Format
    class Field_Form_Original extends \GFPDF\Helper\Fields\Field_Form {
        public function html( $value = '', $label = true ) {
            add_filter( 'gpnf_template_args', function( $args ) {
                $args['template'] = 'nested-entries-detail-simple';
                return $args;
            } );
            $html = GFCommon::get_lead_field_display( $this->field, $this->get_value(), $this->entry['currency'] );
            $html = apply_filters( 'gform_entry_field_value', $html, $this->field, $this->entry, $this->form );
            return \GFPDF\Helper\Helper_Abstract_Fields::html($html);
        }
    }
    add_filter( 'gfpdf_field_class_form', function( $class, $field, $entry ) {
        return new Field_Form_Original( $field, $entry, GPDFAPI::get_form_class(), GPDFAPI::get_misc_class() );
    }, 10, 3 );
    
    Enhancement 
    opened by jakejackson1 10
  • GF_Field::get_value_entry_detail was called incorrectly error

    GF_Field::get_value_entry_detail was called incorrectly error

    GF_Field::get_value_entry_detail was called <strong>incorrectly</strong>. Override this method to handle array values Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 2.0.) in /srv/www/wordpress-default/wp- includes/functions.php on line 4091

    Bug 
    opened by jakejackson1 10
  • Do not generate field container for skipped types

    Do not generate field container for skipped types

    Description

    Previously, the generate function of Helper_Field_Container was not doing anything with the return value of process_skipped_fields. This causes field types which should not have a field container wrapped around them to have one wrapped around them.

    This patch checks the return value of process_skipped_fields and stops generation if true. This will not leave the previous container open, because process_skipped_fields closes it if a skipped field is hit.

    Testing instructions

    1. Add a field type to the skip_fields array via the gfpdf_container_skip_fields filter, enable a display of a skipped field type (such as HTML) via the settings, or create a class for a field type such as page.
    2. Observe that the field container HTML is no longer erroneously being generated.

    Checklist:

    • [x] I've tested the code.
    • [x] My code is easy to read, follow, and understand
    • [x] My code follows the accessibility standards.
    • [x] My code has proper inline documentation / docblocks.
    Won't Fix 
    opened by FPCSJames 9
  • Register and process Gravity PDF mergetag with GF Feeds

    Register and process Gravity PDF mergetag with GF Feeds

    Description

    WIP

    Resolves #960

    Testing instructions

    Screenshots

    Checklist:

    • [ ] I've tested the code.
    • [ ] My code is easy to read, follow, and understand
    • [ ] My code follows the accessibility standards.
    • [ ] My code has proper inline documentation / docblocks.

    Additional Comments

    opened by jakejackson1 7
  • WP UI RTL support

    WP UI RTL support

    Description

    Issue: #1208

    RTL languages like Arabic and Hebrew put WordPress admin in RTL mode, where everything is reversed. All functionality should work as expected under WP RTL mode.

    Testing instructions

    Screenshots

    Checklist:

    • [x] I've tested the code.
    • [x] My code is easy to read, follow, and understand
    • [ ] My code follows the accessibility standards.
    • [x] My code has proper inline documentation / docblocks.

    Additional Comments

    opened by debbieellis7 7
  • Prevent upgrade to v6 if Gravity Forms minimum requirement isn't met

    Prevent upgrade to v6 if Gravity Forms minimum requirement isn't met

    Description WordPress will check PHP ~and WP versions~ and prevent an upgrade to a release that isn't compatible (https://core.trac.wordpress.org/ticket/43987). We should consider extending this behaviour to check the Gravity Forms version so that users don't upgrade to v6 and then have to downgrade right away if they aren't ready to upgrade to 2.5.

    On the other hand, upgrading to 6.0 and then getting an error about an outdated version of Gravity Forms would encourage users to upgrade Gravity Forms as well, which would encourage users to keep up to date.

    Enhancement Consideration 
    opened by jakejackson1 6
  • Move Gravity PDF Uninstaller to Settings -> Uninstall

    Move Gravity PDF Uninstaller to Settings -> Uninstall

    Description Gravity Forms has moved all their add-on uninstaller under Settings -> Uninstall. We should do the same

    Step To Reproduce Steps to reproduce the behavior:

    1. Go to Settings -> Uninstall with a Gravity Forms add-on enabled

    Expected behavior Show Gravity PDF on this list

    Screenshots Screen Shot 2021-03-01 at 11 28 20 am

    Enhancement Help Wanted Backend 
    opened by jakejackson1 6
  • Change where Core Font Installer Notice is shown

    Change where Core Font Installer Notice is shown

    Description Currently, the Core Font Installer notice is shown on all WordPress admin pages outside of Gravity Forms, and any Gravity PDF pages. To reduce notice fatigue for users, only display the notice on the WordPress Plugin screen, all Gravity PDF pages, and the following Gravity Forms screens:

    1. Form List
    2. Form Settings
    3. Form Entry List
    4. Form Entry Details

    Screenshots Screenshot 2022-12-19 at 11 59 23 am

    Enhancement 
    opened by jakejackson1 0
  • Add PHP 8.2 unit test

    Add PHP 8.2 unit test

    Description

    Add PHP 8.2 test runner for PHPUnit

    Testing instructions

    Screenshots

    Checklist:

    • [ ] I've tested the code.
    • [ ] My code is easy to read, follow, and understand
    • [ ] My code follows the accessibility standards.
    • [ ] My code has proper inline documentation / docblocks.

    Additional Comments

    opened by jakejackson1 2
  • License Key Deactivation Bug

    License Key Deactivation Bug

    Description

    Deactivating a license that has already been deactivated via other means will produce an invalid UI state.

    Step To Reproduce Steps to reproduce the behavior:

    1. Activate a License Key for a Gravity PDF extension at Forms -> Settings -> PDF -> License
    2. Go to GravityPDF.com/account/, locate the license key under Licenses, and then deactivate your site
    3. Back in WordPress, click the "Deactivate License" button, and you'll get an error about the license not being activated on the site

    Expected behavior

    At step 3, we should delete the license key from the database and now show the Deactivate License button any longer. The UI should be ready to accept a fresh license key to activate the plugin again.

    Screenshots Screenshot 2022-12-02 at 2 51 44 pm

    Bug 
    opened by jakejackson1 0
  • Add Free Trial support to Core Product Table / PDF Invoices

    Add Free Trial support to Core Product Table / PDF Invoices

    Description Gravity Forms payment add-ons like Stripe offer a Free Trial Subscription. When this is enabled, the Product Table generated by Gravity Forms will include a line item called "Free Trial" with a $0.00 value and in the subtotal area will include the text "Trial Discount" which zeros out the product total.

    Gravity PDF doesn't currently support this feature when generating the Product Table or premium invoices.

    Step To Reproduce Steps to reproduce the behavior:

    1. Install Stripe
    2. Configure Stripe in Test Mode
    3. Create a form with a product
    4. Set up a Stripe Feed with a subscription and free trial enabled
    5. Submit the form
    6. View the Product table on the Entry Details page and/or Notification email
    7. Set up a Core PDF on the form and view the PDF

    Expected behavior The Product table generated by Gravity PDF for Core and Universal templates should include the free trial information.

    Support for this feature should be added to premium Invoice PDFs as well.

    Enhancement 
    opened by jakejackson1 0
  • If a custom font fails to install, upon retrying automatically disable OTL checker.

    If a custom font fails to install, upon retrying automatically disable OTL checker.

    Description

    The Noto Sans Bold TTF font file (downloaded direct from fonts.google.com) causes a PHP fatal error due to a max memory issue upon adding to the Font Manager.

    The reasons for the fatal error is when mPDF is parsing the font file the OTL Ligature set data extracted from the file is creating some very large loops. This suggests there is an underlying issue with mPDF's font reader, but I don't know enough about working with binary font files in PHP, or their structure, to make any sort of determination.

    The workaround I have come up with is to disable the OTL checker if the installation fails and the user selects retry. This will prevent the Ligature set from being extracted from the OTL font data, and stop the fatal error.

    Step To Reproduce Steps to reproduce the behavior:

    1. Download the Noto Sans zip from Google Fonts
    2. Open the Font Manager
    3. In the Add Font panel, select the Noto Sans Bold TTF font file for the Regular box and save
    4. See error

    Expected behavior The font successfully saves.

    Enhancement Backend Frontend 
    opened by jakejackson1 1
  • Add Specific Gravity Flow field support to Gravity PDF

    Add Specific Gravity Flow field support to Gravity PDF

    Description Gravity Flow registered a number of fields for Gravity Forms. While the fallback Gravity PDF uses will correctly display these in the PDFs, some are not optimized in the $form_data array.

    Let's register specific PDF fields for these Gravity Flow fields and determine the best output and the best $form_data array structure.

    Enhancement 
    opened by jakejackson1 0
Owner
Gravity PDF
Automatically generate highly-customisable PDF documents using Gravity Forms.
Gravity PDF
Official clone of PHP library to generate PDF documents and barcodes

TCPDF PHP PDF Library Please consider supporting this project by making a donation via PayPal category Library author Nicola Asuni [email protected] co

Tecnick.com LTD 3.6k Dec 26, 2022
FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF.

FPDI - Free PDF Document Importer ❗ This document refers to FPDI 2. Version 1 is deprecated and development is discontinued. ❗ FPDI is a collection of

Setasign 821 Jan 4, 2023
Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2

Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2. If you have an enabled template and a default template for the store you need your template the system will print the pdf template.

EAdesign 64 Oct 18, 2021
Simple wrapper package around MPDF's setProtection method that allows you to set password on PDF files

Laravel PDF Protect (fork) Simple wrapper package around MPDF's setProtection method that allows you to set password on PDF files. Installation You ca

Raphael Planer 2 Jan 23, 2022
Generate simple PDF invoices with PHP

InvoiScript Generate simple PDF invoices with PHP. Installation Run: composer require mzur/invoiscript Usage Example use Mzur\InvoiScript\Invoice; re

Martin Zurowietz 16 Aug 24, 2022
Generate pdf file with printable labels

printable_labels_pdf Generate pdf file with printable labels with PHP code. CREATE A PDF FILE WITH LABELS EASELY: You can get a pdf file with labels f

Rafael Martin Soto 5 Sep 22, 2022
Generate PDF invoices for your customers in laravel

What is Invoices? Invoices is a Laravel library that generates a PDF invoice for your customers. The PDF can be either downloaded or streamed in the b

Erik C. Forés 399 Jan 2, 2023
Rapidly Generate Simple Pdf, CSV, & Excel Report Package on Laravel

Laravel Report Generators (PDF, CSV & Excel) Rapidly Generate Simple Pdf Report on Laravel (Using barryvdh/laravel-dompdf or barryvdh/laravel-snappy)

Jimmy Setiawan 513 Dec 31, 2022
A PHP tool that helps you write eBooks in markdown and convert to PDF.

Artwork by Eric L. Barnes and Caneco from Laravel News ❤️ . This PHP tool helps you write eBooks in markdown. Run ibis build and an eBook will be gene

Mohamed Said 1.6k Jan 2, 2023
Convert HTML to PDF using Webkit (QtWebKit)

wkhtmltopdf and wkhtmltoimage wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF and various image formats using the QT Webk

wkhtmltopdf 13k Jan 4, 2023
A Laravel package for creating PDF files using LaTeX

LaraTeX A laravel package to generate PDFs using LaTeX · Report Bug · Request Feature For better visualization you can find a small Demo and the HTML

Ismael Wismann 67 Dec 28, 2022
Convert HTML to PDF using Webkit (QtWebKit)

wkhtmltopdf and wkhtmltoimage wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF and various image formats using the QT Webk

wkhtmltopdf 13k Jan 9, 2023
plugin de criação de PDF através do HTML fácil

pluginmpdf plugin de criação de PDF através do HTML Para inciar nosso pluginmpdf devemos instalar a lib abaixo. mPDF is a PHP library which generates

EAD TUTORIA 2 Mar 24, 2022
Pdf and graphic files generator library written in php

Information Examples Sample documents are in the "examples" directory. "index.php" file is the web interface to browse examples, "cli.php" is a consol

Piotr Śliwa 335 Nov 26, 2022
A PDF conversion and form utility based on pdftk

php-pdftk A PDF conversion and form utility based on pdftk. Features php-pdftk brings the full power of pdftk to PHP - and more. Fill forms, either fr

Michael Härtl 800 Jan 9, 2023
HTML to PDF converter for PHP

Dompdf Dompdf is an HTML to PDF converter At its heart, dompdf is (mostly) a CSS 2.1 compliant HTML layout and rendering engine written in PHP. It is

null 9.3k Jan 1, 2023
PHP library generating PDF files from UTF-8 encoded HTML

mPDF is a PHP library which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF (see CREDITS), with a number of enhancement

null 3.8k Jan 2, 2023
PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage

Snappy Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. It uses the excellent webkit-based wkhtmltopd

KNP Labs 4.1k Dec 30, 2022
TCPDF - PHP PDF Library - https://tcpdf.org

tc-lib-pdf PHP PDF Library UNDER DEVELOPMENT (NOT READY) UPDATE: CURRENTLY ALL THE DEPENDENCY LIBRARIES ARE ALMOST COMPLETE BUT THE CORE LIBRARY STILL

Tecnick.com LTD 1.3k Dec 30, 2022