Open gbnew opened 2 months ago
i check the document ,images file is not in the word zip file.
why the image is not in file,the path is correct.
`foreach ($sceneCheckList as $item) { $table->addRow(); $table->addCell(200)->addText($row_total++); //$table->addCell(2000)->addText($item['picUrl']); // 第二列:插入图片 $picUrlAry=explode(',',$item['picUrl']);
//var_dump($picUrlAry); if (count($picUrlAry)>0) { $cell = $table->addCell(2000); // 创建一个较大的单元格 $cell->addText('隐患图片:'); // 添加文本标题 $cell->addBreak(); // 换行 foreach ($picUrlAry as $picUrl) { if($picUrl){ $imageStyle = array('width' => 100, 'height' => 100, 'wrappingStyle' => 'behind'); //echo "<img src='../../".$picUrl."'>"; $filePath = realpath($picUrl); if ($filePath !== false) { echo "文件的绝对路径是: $filePath"; } else { echo "文件不存在或者路径有误"; } $cell->addImage($picUrl, $imageStyle); $cell->addBreak(); // 换行 } } } else { $table->addCell(2000)->addText('无图片'); }`
3
7.4.3
i try it again ,if i use section container the images can insert into document,but i use cell container the image only a blank without picture,the php had aready turn on the GD library.
Describe the bug and add attachments
i check the document ,images file is not in the word zip file.
Expected behavior
why the image is not in file,the path is correct.
Steps to reproduce
`foreach ($sceneCheckList as $item) { $table->addRow(); $table->addCell(200)->addText($row_total++); //$table->addCell(2000)->addText($item['picUrl']); // 第二列:插入图片 $picUrlAry=explode(',',$item['picUrl']);
PHPWord version(s) where the bug happened
3
PHP version(s) where the bug happened
7.4.3
Priority