• Resolved guena

    (@guena)


    Hello,
    First of all, congratulations for this great plugin. However, I have a problem, when I want to preview the template, the following error message appears.

    Parse error: syntax error, unexpected ‘[‘ in C:\Users\GRANIT-DAO\Desktop\InstantWP_4.5\iwpserver\htdocs\wordpress\wp-content\plugins\woo-pdf-invoice-builder\vendor\dompdf\dompdf\src\FrameDecorator\AbstractFrameDecorator.php on line 891

    Do you have any idea how to solve the problem?
    Thank you in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    That seems to be a compatibility error with older versions of php. I am going to fix this in the next release but if you want to fix it right away please open the file C:\Users\GRANIT-DAO\Desktop\InstantWP_4.5\iwpserver\htdocs\wordpress\wp-content\plugins\woo-pdf-invoice-builder\vendor\dompdf\dompdf\src\FrameDecorator\AbstractFrameDecorator.php and change this:

     foreach($this->get_children() as $child)
            {
                if($child->is_text_node()&&$child->get_text()=='')
                    continue;
                $height+=$child->get_padding_box()['h'];
    
            }
    

    for this:

     foreach($this->get_children() as $child)
            {
                if($child->is_text_node()&&$child->get_text()=='')
                    continue;
                $paddingBox=$child->get_padding_box();
                $height=$paddingBox['h'];
    
            }
    

    that should do the trick =).

    Regards!

    I get the following error..

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) in /home/myusername/public_html/wp-content/plugins/woo-pdf-invoice-builder/vendor/phenx/php-font-lib/src/FontLib/Table/Type/loca.php on line 43

    • This reply was modified 6 years, 11 months ago by Pigo3934blog.
    Plugin Author EDGARROJAS

    (@edgarrojas)

    Got it, this is very technical but the first time the plugin tries to generate a pdf the font files are compiled, this is done in your server to increase the accuracy of the file generated. It seems that your server is struggling to finish this compilation. So please download the file at https://rednao.com/fonts.zip unzip it and place the content at vendor\dompdf\dompdf\lib\fonts, the zip file contains the precompiled font files (which were generated in my machine) so hopefully that will fix it and the pdf will be accurate enough.

    Regards!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Syntax error’ is closed to new replies.