Forum


Replies: 1   Views: 450
Merged docx cannot be transformed to html
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 syncflipper  · 20-07-2021 - 16:12

Hello!
 

After merging some docx files, I am trying to transform the document to HTML format, but I am getting this error: 

Call to undefined method DOMText::getElementsByTagNameNS()

file: phpdocx/Classes/Phpdocx/Transform/TransformDocAdvHTML.php:2529

The merge function is as follows: 

$docxMerger = new Phpdocx\Utilities\MultiMerge();

$result = $docxMerger->mergeDocx($firstDocument, $docArray, $destination, ['mergeType'=> 1,'preserveStyleDefaults' => true, 'enforceSectionPageBreak' => true, 'numbering' => 'continue']);

 

The transform function is the same as your example.

The issue dissapears if I open the file with MSWord and save it again.
 

Thank you

Posted by admin  · 20-07-2021 - 16:36

Hello,

What version and license of phpdocx are you using? Maybe the DOCX is using a not supported content or style by Word to HTML feature (https://www.phpdocx.com/documentation/introduction/word-to-html-PHP) in the version you are using.

As your username doesn't have a license tied, please send to contact[at]phpdocx.com the username or email of the user that purchased the license and the DOCX that returns the error so we can check it.

Regards.