1

嗨,我正在使用 PHPDOCX 创建一个 word 文档,下面的代码创建了一个文本框,但我在自定义其样式时遇到了问题。如果我可以发布一张图片,我可以显示我的问题是什么。下面的代码创建了一个三个文本框我的问题是文本框中的最后一个文本有一个额外的填充底部,所以看起来文本框在底部有一个额外的空白空间。第二个问题是每个文本框之间都有很大的空间我希望我可以使用底部边距将其删除。最后我如何设置文本框中文本的字体大小。

更新了图片希望我现在能得到帮助

$array = array('Drop Units OCAP'
                ,'Drop Units Details: Drop units inside carriers'
                ,'Drop Units Details: Drop units inside carriers Drop Units Details: Drop units inside carriers');




foreach($array as $value){

    $wordML = '<w:p><w:r><w:pict>
                  <v:shape  type="#_x0000_t202" 
                  style="position:absolute; z-index:99999999; width: 590;    " 
                  fillcolor = "#94BDDA;" strokecolor="none; ">

                      <v:textbox  style="mso-fit-shape-to-text:t; " inset="5pt,0pt,0pt,0pt" >
                        <w:txbxContent>
                           <w:p>
                              <w:r>
                                <w:t> '.$value.'
                                </w:t>
                              </w:r>
                            </w:p>
                        </w:txbxContent>
                      </v:textbox>
                      <w10:wrap type="square"/>
                  </v:shape>
                </w:pict></w:r></w:p>';

    $docx->addWordML($wordML);
}

$docx->createDocx('example_addTextBox_1');

在此处输入图像描述

4

0 回答 0