Forum


Replies: 2   Views: 1646
Addimage - no bottom border
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by visor  · 26-05-2020 - 18:42

Hi,

trying to add images(code below), but does botton border is not showing when openinh generated document. If i open generated document, and rescale image - bottom border appears. 

$options = array(
                            'src' => $tmpfname,
                            'imageAlign' => 'center',                                                
                            'scaling' => $x_scale,
                            'spacingTop' => 10,
                            'spacingBottom' => 10,
                            'spacingLeft' => 0,
                            'spacingRight' => 20,
                            'textWrap' => 0,
                            'borderStyle' => 'solid',
                            'borderWidth' => 1,
                            'borderColor' => '0000CD',
                            'dpi' => 75,
                        );

                        $docx->addImage($options);

Posted by admin  · 26-05-2020 - 19:09

Hello,

We have run the following code:

$options = array(
    'src' => 'image.png',
    'imageAlign' => 'center',
    'scaling' => 150, // if we set it to other values it works correctly too
    'spacingTop' => 10,
    'spacingBottom' => 10,
    'spacingLeft' => 0,
    'spacingRight' => 20,
    'textWrap' => 0,
    'borderStyle' => 'solid',
    'borderWidth' => 1,
    'borderColor' => '0000CD',
    'dpi' => 75,
);

$docx->addImage($options);

With some images, and the border appears correctly opening the DOCX with all DOCX readers we have tested: LibreOffice 6, MS Word 2007, MS Word 2010, MS Word 2013, MS Word 2016 and MS Word 2019.

What DOCX reader are you using? If you send the DOCX output and the image you are using we'll check them.

Regards.

Posted by visor  · 27-05-2020 - 14:11

Problem resolved. Bottom border did not appear if 'spacingBottom' => 0. Thank you for quick reponse