This action is run right after a PDF is saved to disk. It allows you to copy the PDF to another location (do not move the PDF otherwise you'll break the PDF notifications).
It will be triggered when a Gravity Forms notification is sent AND the PDF is configured to be attached to it – this includes during the initial form submission and when resending notifications. It will also be triggered during the form submission when the Always Save PDF setting is enabled or when using
GPDFAPI::create_pdf( $entry_id, $pdf_id ) method in our API.
You can also use the
gfpdf_post_save_pdf_$form_id action if needed.
$pdf_path | string
- The full path to the generated PDF
$filename | string
- The filename of the generated PDF
$settings | array
- The current PDF's settings
$entry | array
- The raw Gravity Form Entry array.
$form | array
- The current Gravity Form array
This snippet shows you how to copy the generated PDF to a separate directory on your server. Keep in mind that unless the folder you copy to is placed outside the root website directory your PDFs will be publicly accessible from this new folder:
You can also use the form-specific action and remove the IF statement:
You might also like to copy all PDFs to another directory and group them by their forms:
This action is located in the
Model_PDF::generate_and_save_pdf() method of