PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.16k stars 2.68k forks source link

cloneBlock property does not function properly with files exceeding 145KB in the template. #2584

Open jcesarht opened 3 months ago

jcesarht commented 3 months ago

Describe the Bug

Hi there,

I need assistance regarding a template property issue.

I attempted to export a document, and the process seems to be working fine. However, the information within it is incomplete. Here's the situation:

I imported the template using the following code: $this->document = new TemplateProcessor('file.docx');.

The document is divided into three parts. The first part functions correctly. The second part involves cloning a section with $this->document->cloneBlock('name_block', 0, true, false, $array_values), which works as expected. However, upon adding a circular shape to the third part, the second section malfunctions.

Upon investigation, I discovered that the template exceeds 145 KB, causing it to malfunction. However, removing the shape resolves the issue, and the code functions correctly.

Could you please assist me with this? I'm unsure how to proceed with troubleshooting. A clear and concise description of what the bug is.

Steps to Reproduce

Please provide a code sample that reproduces the issue.

<?php
require __DIR__ . '/vendor/autoload.php';

$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$section->...

Expected Behavior

A clear and concise description of what you expected to happen.

Current Behavior

What is the current behavior?

Context

Please fill in your environment information: