PHPWORD - 在docx文件的每个页面上的文本前插入图像

Using PhpWord library, please tell me if it is possible to insert an image in front of text and on every page, in the same position, when creating a new docx file.

You could use a development version which implements this:

Have a look at this issue: https://github.com/PHPOffice/PHPWord/issues/939

This pull request implements this: https://github.com/PHPOffice/PHPWord/pull/1084

here is a simple example to illustrate what I meant with using global header to place an image in the top of every page (with single section containing a long table):

$phpWord = new \PhpOffice\PhpWord\PhpWord();

$section = $phpWord->addSection();

$header = $section->addHeader();
$header->addImage('resources/PhpWord.png', array('width' => 80, 'height' => 80, 'alignment' => \PhpOffice\PhpWord\SimpleType\Jc::START));

// generate long table just for demo that spans over multiple pages
$table = $section->addTable();
for ($i = 0; $i < 200; $i++) {
    $table->addRow();
    $table->addCell(4500)->addText('dummy');
    $table->addCell(4500)->addText("contents $i");
}