Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Sep 29, 2017 4:00 pm

I am appending HTML strings to paragraphs i create in a temporary section.

var p = tmpSection.AddParagraph();
p.AppendHTML("test without paragraph");
p.ApplyStyle(BuiltinStyle.Heading1);
p.Format.BeforeSpacing = 3;
p.Format.AfterSpacing = 3;

p = tmpSection.AddParagraph();
p.AppendHTML("<p>test with paragraph</p><p>test with paragraph</p>");
p.ApplyStyle(BuiltinStyle.Heading1);
p.Format.BeforeSpacing = 3;
p.Format.AfterSpacing = 3;

I notice that for the second part of the code where the HTML to append contains a paragraph or more, the Spacing Instructions are ignored. When i check in the resulting Word, the spacing is set to "Auto" instead of 3pt. For the first paragraph, the settings are set correctly.

I also notice that the style "Normal" is showing in Word, however, it is not really applied. Only if i press "Normal" style manually the formatting is adjusted.

Please help, i need to ensure consistent spacing if my html contains paragraphs or not.

mhofer1976
 
Posts: 5
Joined: Thu Mar 09, 2017 12:24 pm

Sat Sep 30, 2017 3:16 am

Hello,

Thanks for your inquiry.
I have reproduced the issue and referred it to our dev team for a further investigation.
Once there's any update, I will let you know.
Sorry for the inconvenience caused.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Oct 23, 2017 8:55 am

Hello,

Thanks for waiting.
Now the issue has been fixed in Spire.Doc Pack(hot fix) Version:6.0.31, please add following code before setting the space.
Code: Select all
            p.Format.BeforeAutoSpacing = false;
            p.Format.AfterAutoSpacing = false;

Looking forward to your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Oct 24, 2017 8:16 am

Hi,

Greetings from E-iceblue.
Has your issue got resolved?
Thanks in advance for your valuable feedback and time.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.Doc