When using addImage with a border the top border is getting cut-off / not rendered.
If I export to PDF the top border is still missing, even in the PDF.
Going into "Format Picture" in Word and changing anything (like moving Transparency from 0% to 1%) causes the top border to then get rendered.
So it seems like the code getting generated by phpdocx is missing something or is incorrect in some way that gets fixed by Word when the image is edited. The problem is the Word doc I'm generating has dozens of images that all have this problem.
Here is simple code that demonstrates the problem.
<?php require_once $_SERVER["DOCUMENT_ROOT"] . '/includes/phpdocx-12/classes/CreateDocx.php'; $docx = new CreateDocx(); $docx->modifyPageLayout( 'letter', array( 'marginLeft' => round(1440 * 0.75), 'marginRight' => round(1440 * 0.75) ) ); $img = 'testDocx.jpg'; $width = 600; $height = 600; $docx->addText( 'Heading Text', array( 'fontSize' => 10, 'textAlign' => 'left', 'bold' => true, 'caps' => true, 'keepLines' => true, 'keepNext' => true ) ); $imgOptions = array( 'src' => $img, 'spacingTop' => 0, 'spacingBottom' => 0, 'spacingLeft' => 0, 'spacingRight' => 0, 'textWrap' => 0, 'imageAlign' => 'center', 'width' => $width, 'height' => $height, 'borderColor' => 'AAAAAA', 'borderStyle' => 'solid', 'borderWidth' => 1, ); $docx->addImage($imgOptions); $docx->createDocxAndDownload('test'); ?>
The image is an 1800 x 1800 screen capture of a map (I didn't see a way to attach it) that gets scaled to 600 x 600.