Forum


Replies: 5   Views: 279
Remove watermark added by phpdocx
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 04-09-2024 - 15:01

Hello,

If we run the following code:

$docx = new CreateDocx();

$docx->addText('Section 1A');
$docx->addBreak(array('type' => 'page'));
$docx->addText('Section 1B');

$docx->addSection('nextPage', 'A4-landscape');
$docx->addText('Section 2A');
$docx->addBreak(array('type' => 'page'));
$docx->addText('Section 2B');

$docx->addSection('nextPage', 'A4');
$docx->addText('Section 3A');
$docx->addBreak(array('type' => 'page'));
$docx->addText('Section 3B');

$docx->createDocx('new_document');

$docxUtilities = new DocxUtilities();
$docxUtilities->watermarkDocx('new_document.docx', 'new_document_watermark.docx', 'text', array('text' => 'phpdocx'));

that adds: two pages, a section break with a landscape layout, two pages, a section break with a portrait  layout, and two pages. A watermark is added to all sections.

If we open the DOCX output with MS Word and choose "Remove Watermark", all watermarks are removed correctly. However, as explained in our previous reply, removing watermarks per section may sometimes be needed.

For further support, we'd need to check the DOCX output and the watermarkDocx options you are using. You can send them to contact[at]phpdocx.com

Regards.