Hello how can i change the currency in PDF? Right now it is showing $ and my form is in AED. how can i change pdf currency to AED? thank you
]]>I’m not sure why I’m seeing this and what it means, after I downloaded and activated the plugin from www.ads-software.com.
The Gravity PDF plugin has a new home! In order to get updates direct from GravityPDF.com you need to perform a one-time download of the plugin.
Can you explain why I need to do this and what it means?
Gary
]]>Hi Jake Jackson @blue-liquid-designs
Issue with Rendering Post Title in Gravity PDF
I’m experiencing a challenge with rendering the Post Title in the PDF generated by Gravity PDF in my WordPress setup. I have implemented a custom filter to merge the tag for the Post Title, but it still does not appear in the final PDF output. The default {post_title} is not working.
// Add custom filter for Post Title
add_filter('gform_custom_merge_tags', 'custom_post_title_merge_tag', 10, 4);
function custom_post_title_merge_tag($merge_tags, $form_id, $fields, $element_id) {
// Add custom merge tag for Post Title
$merge_tags[] = array(
'label' => 'Post Title',
'tag' => '{post_title}',
);
return $merge_tags;
}
// Add filter to modify Post Title value
add_filter('gform_replace_merge_tags', 'replace_post_title_merge_tag', 10, 7);
function replace_post_title_merge_tag($text, $form, $lead, $url_encode, $esc_html, $nl2br, $format) {
// Check if our custom merge tag exists in the text
if (strpos($text, '{post_title}') !== false) {
// Get the current post title
$post_title = get_the_title();
// Replace the merge tag with the post title
$text = str_replace('{post_title}', $post_title, $text);
}
return $text;
}
Then, I used the following custom filter after above code failed to render
add_filter('gravitypdf/template/replace', function($template, $form, $entry) {
$template['post_title'] = get_the_title($entry['post_id']);
return $template;
}, 10, 3);
I tried replacing form_title
since it renders correctly, but it still isn’t working. I have attempted many custom filters, but none of them have helped render the post title..
// Gravity Form custom merge tag for post title for Gravity PDF
add_filter('gform_pre_replace_merge_tags', function($text, $form, $entry, $url_encode, $esc_html, $nl2br, $format) {
$merge_tag = '{form_title}';
// Return original text if merge tag not found or if form is empty
if (strpos($text, $merge_tag) === false || empty($form)) {
return $text;
}
// Method 1: Get current post ID first
$current_post_id = get_queried_object_id();
$current_post_title = get_the_title($current_post_id);
// Alt Method 2: If first method returns empty, try getting from global post
if (empty($current_post_title)) {
global $post;
if ($post && $post->ID) {
$current_post_title = get_the_title($post->ID);
}
}
// Alt Method 3: Fallback - try to get from URL
if (empty($current_post_title)) {
$post_id = url_to_postid($_SERVER['REQUEST_URI']);
if ($post_id) {
$current_post_title = get_the_title($post_id);
}
}
// Debug: Log the title and post ID
error_log('Post ID: ' . $current_post_id);
error_log('Post Title: ' . $current_post_title);
// Only replace if we actually got a title
if (!empty($current_post_title)) {
return str_replace($merge_tag, $current_post_title, $text);
}
return $text;
}, 10, 7);
// Hook to change Form title to Post Tite
add_filter('gform_form_settings', function($form) {
// Store the current post title in the form settings
$form['title'] = get_the_title();
return $form;
}, 10, 1);
// Render Post Title
add_filter('gform_pre_render', function($form) {
// Get current post ID
$current_post_id = get_the_ID();
if ($current_post_id) {
// Get the post title
$post_title = get_the_title($current_post_id);
// Update form title
if ($post_title) {
$form['title'] = wp_kses_post($post_title);
}
}
return $form;
}, 10, 1);
add_filter('gform_pre_render', function($form) {
// Debug: Log current context
$debug = array(
'post_id' => get_the_ID(),
'is_single' => is_single(),
'current_post' => get_post(),
'in_the_loop' => in_the_loop()
);
error_log('Gravity Form Context: ' . print_r($debug, true));
// Method 1: Using get_queried_object()
$queried_object = get_queried_object();
if ($queried_object instanceof WP_Post) {
$form['title'] = wp_kses_post($queried_object->post_title);
error_log('Using queried object title: ' . $queried_object->post_title);
}
// Alt Method 2: Using global post
global $post;
if ($post instanceof WP_Post) {
$form['title'] = wp_kses_post($post->post_title);
error_log('Using global post title: ' . $post->post_title);
}
return $form;
}, 10, 1);
Please suggest how to make Post Title render in the PDF.
Thanks in Advance
]]>To get help and support with Gravity PDF please use our Support Portal to contact us.
]]>hello i want to ask how can i resize the backround image in a pdf? coz even i put small size image it would still stretch into bigger size. pls advise thank you
]]>Hello as we all know that gform has HIDDEN FIELD and this field does not have custom css setting to put ‘exclude’. How can i hide it in gravityPDF?
]]>Hello
The plugin works fine, but i can’t get it to show a new field of another plugin (a signature field): https://www.ads-software.com/plugins/digital-signature-for-gravity-forms/
Is there a way to add it to the pdf?
Thanks!
]]>I am having an issue with the PDF’s being blank? Any ideas where I can start the trouble shooting? PHP 8.3 environment. Not sure if related but Clean Talk has been flagging the form submissions as spam but this was recently. All entries when View PDF link is clicked opens blank pdf.
]]>Hello,
When I put persian characters in lists of gravity forms and show theme in the gravity pdf, all of them appear as square symbols.
What should I do?
I attach related screenshot.
]]>Hi guys – I love this tool, and I love the templating system. It’s all so easy, and useful.
Can you please see attached screenshot from my latest PDF, where is this coming from? and how do I get rid of it? Originally, I had a function to print_r all the form_data, but it’s been removed.
Gravity PDF is still creating and printing out this ‘last page’:
Generated in 3.39 seconds
Peak Memory usage 97.19 MB
Number of fonts 4
Screenshot to the problem:
Thanks!
]]>We recently implemented a couple of Gravity Forms?assessments that ask a bunch of questions, collects customer info, then spits out the PDF report and added the shortcode download option to use a?signed URL.
All of this works in fine on the staging environment, but not on production. It gives an error stating “You do not have access to view this PDF” when attempting to download, which is the error generated if the signing function weren’t in place.
We have checked file permissions issues, bypassed load balancer and proxies, triple-checked the configuration, etc. and we are stumped. However, the production environment uses two load-balanced servers for the website. Is there a key that’s generated that could be conflicting or not being managed by one or other of the servers? Any other possibilities?
Thanks!
Hi all! Can someone please show me how to load my CSS file from my php template?
My template has over 600 lines of CSS, so I’m just trying to clean it up a bit.
I have already tried this:
https://docs.gravitypdf.com/v6/developers/filters/gfpdf_include_list_styles
and this:
$stylesheet = file_get_contents(‘assets/mpdfstylePaged.css’);
$mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text
without success.
Thanks! Corrie
]]>I am also having a conflict while submitting the form it is showing this in console and not submitting the form
Failed to load resource: the server responded with a status of 500 ()
]]>
First, thanks for an excellent plugin! Feature-rich and super helpful.
We are using the signed secure PDF URL to allow users to download the PDF without being logged in, as the form users are not WP users. On the “Protocols in Place to Protect Your Data” page under “Default Security,” item 3, it states:
“If the user’s IP doesn’t match, or the 20-minute timeout window has expired, AND the entry owner was originally logged in when completing the form they will be redirected to a login page.”
This also seems to be the case for signed PDFs. I looked and maybe I missed it, but is there a way to redirect the user to a custom URL rather than the login page? The form users will never be register on the website.
Thanks!
Hello!
How do I make the link in the template open in a new window?
No attribute target=”_blank”
]]>I installed your plugin yesterday (great plugin by the way) and the malware scanner pinged your file as being infected. This is a staging site and I have deleted the plugin. The details are:
File: wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/mpdf/mpdf/src/Mpdf.php
We have removed the plugin.
]]>Does this plugin allow PDFs to be generated/sent when the form is submitted?
]]>Hello
This is the error that occurs when using the footer code in my custom template: Undefined index:?html_MyCustomFooter?in /home/xxx.com/public_html/wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/mpdf/mpdf/src/Tag/SetHtmlPageFooter.php on line 50
I have a form with the HTML content for T & C and below there is signature with date and name field. HTML Block notification in email shows all but Gravity PDF shows only signature with date and name field. Kindly let me know how can i show HTML content for T & C in Gravity PDF.
]]>Hi
New custom templates cannot be loaded – the plugin does not see them
]]>Hi! The Shortcode button doesn’t work – it doesn’t copy anything. How do I find out the shortcode in another way? https://postimg.cc/LnNq7WqL
]]>Hello
Is it possible to display a link to a pdf file in the template?
]]>Hi,
I’m using {date_dmy} in the PDF’s header, but it prints “today”‘s date.
I want to print the date when the entry was submitted.
How can I do that?
Thanks.
]]>Maybe I am missing something, but once you get all the PDF design setting the way you want them is there a way to preview what the PDF will look like?
]]>Dear Support Team,
Following a conflict test, I’ve determined that the plugin is interfering with Gravity Forms functionality. With this plugin activated, I’m unable to drag and drop fields when creating a new form.
This issue persists even when using the 2020 theme. Would you please advise on how to resolve this conflict?
Thank you for your assistance.
]]>Hi! how to use the payment status in the logic of displaying template data?The code $status = $form_data[‘misc’][‘payment_status’]; does not show anything
]]>Hello, i have the PSR-4 library installed in my root composer.json, due to the use of GuzzleHTTP.
This generate a Fatal conflict with Gravity PDF. How can this be solved? Thanks.
[05-Dec-2023 11:52:24 UTC] PHP Fatal error: Declaration of GFPDF_Vendor\Mpdf\PsrHttpMessageShim\Request::getRequestTarget() must be compatible with Psr\Http\Message\RequestInterface::getRequestTarget(): string in xxxxx/wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/mpdf/psr-http-message-shim/src/Request.php on line 51
Hello, I’m experiencing the following error and wanted to know if you could help me. Create a template to show a logo-type image that each user can upload to their PDF form.
The code is as follows:
It even works very well and uploads images with the option of the “images of entries” form, the problem arises if the user does not upload any images, instead of leaving the blank field producing a critical error on the web.
What should be done so that the space remains blank if the user does not upload an image?
I attach a link with the images of the problem
This is how it works if an image is loaded:
This is what it does when an image is not uploaded to the form
Since you are very grateful
]]>Hi guys, my name is Giuseppe and I have a question for you. Tell me the procedure for changing the style of the PDF template (I use zadani) of some fields I have in a form. I know html, css, and a little php. If in my form I have a text field with id 3 and an end-of-section field with id 5, explain to me how I could, for example, change the color of the text. Thank you in advance and I apologize for my English.
]]>I am trying to match the original PDF as closely as possible. I have a List field that accepts these values.
Rather than just use the merge tag {Employers:97:} how might I insert the individual answers to these questions into this layout, either by echoing form data or using some variation of the merge tag?
Glad to provide more detail if my question isn’t clear. Thank you!
]]>