Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter sqhendr

    (@sqhendr)

    it looks like “useActiveForms” was set to ‘false’ in the mPDF configuration. Once that’s set to ‘true’, the forms are fillable. Is there any reason why that was set to ‘false’ and is there any way to alter that configuration without changing the plugin code?

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi sqhendr,
    The software cannot handle active form elements and they are stripped out when the PDF is processed.

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi Sqhendr,

    I’m just following up to your original support request.

    In regard to your query, we weren’t satisfied with mPDF’s compatibility with active form fields and do not support it, so it was disabled by default.

    In regards to modifying the configuration without modifying the core plugin, this should be possible using the gfpdfe_pre_render_pdf filter (see line 206 of /helper/pdf-render.php), although this filter is called after the HTML is assigned to the PDF so I can’t say if this will work correctly.

    add_filter('gfpdfe_pre_render_pdf', 'pdf_modify_config');
    function pdf_modify_config($mpdf);
    {
    	$mpdf->useActiveForms = true;
    	return $mpdf;
    }
    Thread Starter sqhendr

    (@sqhendr)

    Great, thanks! I’ll use the filter to get that active.

    Thread Starter sqhendr

    (@sqhendr)

    Just an update: it appears that the filter does not work. It would be great if there was a way to change that setting somewhere so that it wasn’t necessary to update the code manually every time there’s an update for the plugin.

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi,

    Thanks for the feedback.

    I’ve just pushed out an update (3.5.4) which contains a filter run right after the $mpdf object is created. It will allow you to correctly enable the form fields and I’ve tested the filter to ensure it functions as expected.

    Just add the following to your functions.php file once upgraded to 3.5.4.

    add_filter('gfpdfe_mpdf_class', 'pdf_modify_config');
    function pdf_modify_config($mpdf)
    {
            /* $mpdf object passed by reference so no need to return */
    	$mpdf->useActiveForms = true;
    }
    Thread Starter sqhendr

    (@sqhendr)

    That’s great! I’ll update the plugin and give that a try. Thanks!

    I too am looking for a fillable pdf solution. Basically want to dynamically create a gravity form based on products in our catalog. And then use this plugin to generate the fillable pdf form.
    I tried applying this filter.. with no luck. There wasn’t a fillable form when it was generated. Any other ideas?

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi,

    Just applying this filter by itself does nothing. You would need to create a custom PDF template with form field elements.

    You’ll find additional details about doing this here:

    https://developer.gravitypdf.com/documentation/custom-templates-introduction/
    https://mpdf1.com/manual/index.php?tid=296

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Fillable Fields’ is closed to new replies.