• Resolved LS

    (@lsterling03)


    Do you know why the PDFs will create when I visit the page in Firefox or Safari, but not in Chrome? I have tried an incognito window and a regular window. Each time I get a black screen with a dialog popup that says “Error. Failed to load PDF document.” There’s a reload button, but that doesn’t do anything.

    I have checked the WP debug log and see the following (this is just a excerpt — there are a ton of these errors, but they all say the same thing)

    `[22-Sep-2021 23:37:22 UTC] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/mpdf.php on line 2349
    [23-Sep-2021 00:38:23 Europe/London] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/classes/grad.php on line 955
    [23-Sep-2021 00:38:23 Europe/London] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/classes/otl.php on line 3113

    [23-Sep-2021 00:38:23 Europe/London] PHP Warning: A non-numeric value encountered in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/Tag.php on line 1889
    [23-Sep-2021 00:38:23 Europe/London] PHP Warning: A non-numeric value encountered in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/Tag.php on line 2006
    [23-Sep-2021 00:38:23 Europe/London] PHP Warning: A non-numeric value encountered in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/mpdf.php on line 6387

    • This topic was modified 3 years, 2 months ago by LS.
    • This topic was modified 3 years, 2 months ago by LS.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter LS

    (@lsterling03)

    I have determined that the PDF works if switch to the default mpdf theme (I was using a custom mpdf theme, which used to work, but now doesn’t). So that suggests the problem is somewhere with my code.

    I tried removing all my custom fields one by one, and it seems the issue is being caused by the ACF WYSIWYG field. All of my custom fields are ACF text fields, and they all work in the PDF fine. But as soon as I add the WYSIWYG field content, then I get the error. Is there something special I need to do to get this content into the PDF?

    If I use: get_post_meta( $post->ID, 'professional_activities', true ); I get an error. If I remove “true” I get a PDF, but the output simply says “Array” where that field content should be.

    Is there a way to output content from this field? (It’s just paragraph and bulleted text in that field.)

    Thank you.

    • This reply was modified 3 years, 2 months ago by LS.
    Plugin Author fkrauthan

    (@fkrauthan)

    Hey you need to check with the wordpress documentation. Alternative you can also disable the php depreciation message printing in your PHP settings that will prevent this as well.

    Thread Starter LS

    (@lsterling03)

    I understsand how to display the field. I do it all the time. I was just asking if there was something special I needed to do to get it display in your pdf template, as it was causing an error there.

    After a bunch of trial and error I was able to resolve it by just turning on caching in the mpdf settings. I have no idea why that worked, but I’ll go with that.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Not working in Chrome – PHP deprecated’ is closed to new replies.