• Hi,
    I am using “Send PDF for Contact Form 7” plugin to convert my fields to PDF but unfortunately all my Dynamic Fields are not working which are added to CF7 dynamic field.

    Can anybody help me on this !!It is very urgent.

    Regards
    Sam

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    depends on the pdf generator you use. i believe most tools will keep the styles for print into account.

    you can achieve this as @jshock pointed out before by adding thise code to your theme’s style.css file:

    
    @media print {
        .wpcf7cf-hidden {
            display: block !important;
        }
    }
    
    Thread Starter Sam

    (@samaresh)

    Jules, Thanks I am using https://wordpress.org/plugins/send-pdf-for-contact-form-7/ PDF generator.

    Looks like the above solution is not working for me. Any other alternate?

    Regards
    Sam

    Plugin Author Jules Colle

    (@jules-colle)

    Hi Sam,

    I just tested the plugin and it seems to work. Could you please explain what exactly isn’t working for you?

    Jules

    Thread Starter Sam

    (@samaresh)

    Jules,

    While I am adding the code like [group] <p> this is a test</p> [/group] inside Send PDF CF7(http://prntscr.com/f9pn4i) Here is the refrence ( http://prntscr.com/f9pm89 ).

    Another end while I am receving the PDF in email all the empty filds are reflecting, which should be close.

    REgards
    Sam

    Plugin Author Jules Colle

    (@jules-colle)

    Hi Sam,

    I see. I looked into the code of the PDF plugin, but the plugin doesn’t allow other plugins to filter the text that is being written to the PDF, so there is not much I can do now. If you could convince the author of the plugin to make the text filterable I could edit the text before it is written to the PDF.

    I think the change needs to happen in send-pdf-for-contact-form-7/classes/send-pdf.php at line 556

    The text there should be changed to something like this:

    } else {
      $text = apply_filters('wpcf7pdf_text', $text, $contact_form);
      $mpdf->WriteHTML($text);
    }

    that way I could use the wpcf7pdf_text filter to remove the hidden groups from the PDF

    Thread Starter Sam

    (@samaresh)

    Hi Jules

    Thanks alot for your quick response. Let me try with your code and definitely I will update here.

    Regards
    Sam

    Plugin Author Jules Colle

    (@jules-colle)

    well, the code in itself will not do anything. After the filter is exposed in the PDF plugin I will still need to write some code to actually use the filter.

    If you are okay with WordPress development yourself, the thing you would need to do is extend my class in cf7cf.php, and use the filter to call a function inside the class that executes this code:

    $regex = '@\[[\t ]*([a-zA-Z_][0-9a-zA-Z:._-]*)[\t ]*\](.*?)\[[\t ]*/[\t ]*\1[\t ]*\]@s';
    
    preg_replace_callback($regex, array($this, 'hide_hidden_mail_fields_regex_callback'), $text)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Conditional field are not working in Send PDF for Contact Form 7 Plugin’ is closed to new replies.