Forum


Replies: 6   Views: 3368
Excessive spacing between block's
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 acunnington  · 17-04-2013 - 13:56

Hello



I am having an issue with PHPDocX Pro+ putting excessive spacking between BLOCK's. I have them laid out as follows:




$BLOCK_Example_1$
Content for Example 1
$BLOCK_Example_1$$Block_Example_2$
Content for Example 2
$BLOCK_Example_2$


As you can see, there is no spacing between these two blocks. However, when I run the template through PHPDocX, I am finding that it puts a single line between the blocks, using 11pt Calibri. This creates an excessive spacing and destroys the intended style of the document.



Please could you let me know if there is some workaround, or other option I can provide, to preserve spacing?



Many thanks,

Aaron Cunnington


Posted by acunnington  · 17-04-2013 - 14:14

In the attached screenshot, you can see the issue I am facing. On the left side is the source template, on the right side is the generated document.



Posted by acunnington  · 17-04-2013 - 16:54

I found an interesting solution to my problem.


Instead of closing my code with clearBlocks();, I manually went through and did a cleanTemplateVariable('BLOCK_Example', 'inline'); and this seems to have resolved all of my problems. Perhaps when two blocks are deleted (and deleted in block, not inline) then the document reverts to the default formatting for the void space it created.

Posted by jorgelj  · 18-04-2013 - 09:10

Hello,



Thanks for your post, we'll take a look at it.



Regards.


Posted by acunnington  · 24-04-2013 - 12:19

On further investigation, I think this behavior makes sense. When trying to remove a variable using the 'block' method - it results in a void space. It is reasonable that it would be filled with something. I haven't tested, but I would imagine that if I set my default style to something invisible, or extremely small, then it might use that style instead.



Now that I am removing the elements 'inline', the line itself is staying where it is, with the formatting intact.