We are using CreateDocxFromTemplate with an empty docx file. We then add content on it with embedHTML. We have noticed that before first content we add it creates an empty row of text. How do I get rid of this first empty text line?
We are using CreateDocxFromTemplate with an empty docx file. We then add content on it with embedHTML. We have noticed that before first content we add it creates an empty row of text. How do I get rid of this first empty text line?
Hello,
No extra content is added when using an empty template and phpdocx methods (unless you add it explicitly). We think your issue is the following: MS Word always adds an empty paragraph when an empty document is created; so if you use it as a template, the new content is added after the empty paragraph.
You can remove that empty paragraph using removeWordContent from DOCXPath. You can remove the paragraph and generate a new template without it (faster solution), or remove the paragraph each time you use it (slower solution).
Regards.