View Single Post
 
Old 06-24-2016, 02:41 AM
bbreukelen bbreukelen is offline Mac OS X Office 2016
Novice
 
Join Date: Jun 2016
Posts: 6
bbreukelen is on a distinguished road
Default

Phpdocx has to go through all the xml to find variables and replace them.

One of my hundreds of variables in a page is called $c12lvl1$.
But in the docx it is stored as follows:

HTML Code:
<w:r>
  <w:t>$c12</w:t>
</w:r>
<w:r w:rsidR="00323925">
  <w:t>lv1$</w:t>
</w:r>
So a quick search for $c12lvl1$ will not result in anything. Therefore, phpdocx will have to go through the xml and remove all those unneeded tags like the rsidR tag above.
That takes 3-4 seconds per page which makes processing time way too long for a 10-page document.

If I can do that cleanup before saving my docx template I would save 3 seconds per page every time it's generated.
Reply With Quote