Page 1 of 1

Issue with double spacing in HTML

PostPosted: Sat Aug 11, 2012 7:06 am
by jallen
Hi Jason,

Here is my issue. I am exporting a word document to HTML. I am then using that HTML to build a multipart mime email message. When the email is viewed in a traditional mail client (Outlook, Lotus Notes) the lines appear as being double spaced.

I noted that Word has two line spacing properties, before and after.
word.png
word.png (3.16 KiB) Viewed 1877 times


It appears that only the after spacing property is being carried over to the html.
Code: Select all
<p class="Normal DocDefaults " style="space-after: 0in;line-height: 100%;">&nbsp;</p>


The resulting output is that the mail client is defaulting the before line spacing to double spaced.
notes.png
notes.png (1.88 KiB) Viewed 1877 times


I am guessing some on how this all works. Is there a way to set both the before and after spacing properties when converting to HTML?

Thanks,
Jeff

Re: Issue with double spacing in HTML

PostPosted: Sun Aug 12, 2012 12:18 pm
by jason
Fixed in https://github.com/plutext/docx4j/commi ... 3fbcaeb426

Two things:
1. the CSS property name was wrong
2. when space-before is 0, Word doesn't write the attribute at all in the WordML it emits, so in the absence of the attribute, margin-top is now set to 0.

Re: Issue with double spacing in HTML

PostPosted: Tue Aug 14, 2012 12:44 am
by jallen
Thanks for the fix Jason. Is there a new nightly build for this change so I can test it out?

Re: Issue with double spacing in HTML

PostPosted: Wed Aug 15, 2012 8:27 pm
by jason