Open shadoWalker89 opened 7 years ago
Looks like a bug to me. As far as I can see every run inside a paragraph is being read as as many paragraphs, which explains all the unnecessary new lines.
<w:p w:rsidR="00A00266" w:rsidRDefault="00967524" w:rsidP="00967524">
<w:pPr>
<w:jc w:val="center"/>
<w:rPr>
<w:b/>
<w:sz w:val="72"/>
<w:szCs w:val="72"/>
</w:rPr>
</w:pPr>
<w:r w:rsidRPr="00967524">
<w:rPr>
<w:b/>
<w:sz w:val="72"/>
<w:szCs w:val="72"/>
</w:rPr>
<w:t>T</w:t>
</w:r>
<w:r w:rsidR="00340061" w:rsidRPr="00967524">
<w:rPr>
<w:b/>
<w:sz w:val="72"/>
<w:szCs w:val="72"/>
</w:rPr>
<w:t>est</w:t>
</w:r>
</w:p>
is being read as
<w:p>
<w:pPr>
<w:jc w:val="center"/>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:jc w:val="center"/>
</w:pPr>
<w:r>
<w:rPr>
<w:sz w:val="72"/>
<w:szCs w:val="72"/>
<w:b/>
</w:rPr>
<w:t xml:space="preserve">T</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:jc w:val="center"/>
</w:pPr>
<w:r>
<w:rPr>
<w:sz w:val="72"/>
<w:szCs w:val="72"/>
<w:b/>
</w:rPr>
<w:t xml:space="preserve">est</w:t>
</w:r>
</w:p>
which is obviously not correct
Hi,
I'm using the template processor to populate a file with data and then use the
saveAs('file_saved_using_template.docx')
. Until here everything is working as expected.After that i need to open the saved file with
IOFactory::load('file_saved_using_template.docx')
And do some additional stuff, when i'm done, i download the file usingThe problem is that i find a lot of new lines in the downloaded file
My report.docx
, that doesn't exist infile_saved_using_template.docx
The problem is that in the
file_saved_using_template
.docx` i find bookmarks like this<w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/>
which causes the new lines in the final downloaded file.I looked around and i found out that these bookmarks are added to maintain the cursor position. In the
file_saved_using_template
.docxthery are invisible and doesn't have any effect. In the
My report.docx` they cause new lines