• Resolved witho

    (@witho)


    Hi,

    I see that you fixed a bug with the line breaks but now my generated PDFs are not including the break lines (neither if I write \n inside a line break).

    Can you help me?

    My PDF begins like this:

    Booking Form Online details:

    First name: [bf_first_name]
    Surname: [bf_last_name]
    Address: [bf_address]
    Phone: [bf_phone]
    Email: [bf_email]
    Passport/ Id card: [bf_number_id]

    And have the “Desactivate line break…” options with NO. I tested changing this options, but the preview of the PDF does not change.

    I have updated my plugin with your Github version (1.0.1.9), but still the same issue.

    Thanks!

    • This topic was modified 11 months, 1 week ago by witho.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    I added two options:

    1 – Desactivate line break auto for PDF content?
    This disables automatic line break replacement (\n and \r) in PDF content

    2 – Desactivate line break auto for MAIL?
    This disables automatic line break replacement (\n and \r) in mail content

    Where is your problem? In PDF, mail ?

    Thanks

    Thread Starter witho

    (@witho)

    Hello again,

    The email and the PDF both are showing without the line breaks.

    I saw this 2 new options but any combination of this options is showing the PDF preview without the line breaks.

    Thanks!

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    Have you checked “Use HTML content type” on your form option?

    Thanks

    Thread Starter witho

    (@witho)

    This option (“Use HTML content type”) was already checked.

    Everything was fine until the last updates of the plugin.

    Plugin Author Florent Maillefaud

    (@florent73)

    If you test this form: https://demo.restezconnectes.fr/send-pdf-for-contact-form-7-simple-form/

    It’s working:
    – “Desactivate line break auto for PDF content” on “OFF”
    – “Desactivate line break auto for MAIL?” on “OFF”
    – “Use HTML content type” on “ON” for 2 emails.

    Thanks

    Thread Starter witho

    (@witho)

    Hello,

    I am still having the same problem with the last version of your plugin. Here are my examples:

    Thanks!

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    Have you a plugin for config yours mails?

    I don’t understand what’s going on. On my demos, everything goes smoothly and with several different forms.

    Thanks

    Thread Starter witho

    (@witho)

    No, I only have “WP Mail SMTP” plugin to configure Google as my email server, tht’s it.

    I managed to solve the problem by adding some code to these functions:

    Inside “tags_parser” function that goes into “prepare-pdf.php” file I added this line at the end:

    $contentPdf = str_replace("\r\n", "
    ", $contentPdf);

    Inside “wpcf7pdf_mail_components” filter function into “send-pdf.php” file I added this line at 999 line of code:

    $messageText = str_replace("\n", "
    ", $messageText);

    I know that this mey be not the best solution and I will try to separate my changes from the core of the plugin in order to be able to update your plugin in the future, but with this changes now I can see my emails an PDF with the brek lines as it should be.

    Thanks!

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    I use “WP Mail SMTP” plugin too.

    Yes, my function tags_parser() into “prepare-pdf.php” file, use this :
    – if “Desactivate line break auto for PDF content?” is disabled
    – if “Desactivate line break auto for MAIL?” is disabled

    How are these options?

    Thanks

    Thread Starter witho

    (@witho)

    Both options are disabled as I showed you in prevous replies.

    I saw this code inside your function but it is only inside this condition:

    } else if(isset($basetype) && $basetype==='textarea') {

    And I was trying to debug and saw that my flow never enter in this condition.

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    I added somes lines.

    Can you testing the lastest version in GitHub?

    Thanks

    Thread Starter witho

    (@witho)

    I tested it but the same error. I check the new code and I don’t know why but the code is not replacing the “break lines” with:

    <br />

    And instead is printing a “new line” inside the code.

    Check this out and let me know.

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    I’ve changed the code (GitHub version):

    str_replace("\r\n", "<br />"...

    Thanks

    Thread Starter witho

    (@witho)

    I see, tested and working like a charm.

    Thanks!

    Plugin Author Florent Maillefaud

    (@florent73)

    Thanks a lot!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘PDF break lines not working’ is closed to new replies.