In the application we are working on, when generating document sometimes we have to render paragraphs by using HTML. in most cases the document get renderd correctly ( all the contant stay with in the page margin) however in some cases it won't appear like we expect it to be.
below demonstrate my code
- Code: Select all
string htmlString = "CHECK BELOW FOR FULL HTML CODE";
Section workingSection = _agendaDocument.Sections[0];
Paragraph cellTwoPara = workingSection.AddParagraph();
cellTwoPara.AppendHTML(htmlString);
cellTwoPara.Format.HorizontalAlignment = HorizontalAlignment.Justify;
cellTwoPara.ApplyStyle("EcuriaBodyStyle");
cellTwoPara.Format.AfterAutoSpacing = false;
cellTwoPara.Format.AfterSpacing = 15;
My SAMPLE HTML CODE
- Code: Select all
<ol style="margin-top:0;margin-bottom:0;">
<li style="text-align:justify;margin:0pt 0pt 0pt 0pt;list-style-type:decimal;color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:bold;font-style:normal;">
<span style="color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:bold;font-style:normal;">That the deputation be received and noted.</span></li>
<li style="text-align:justify;margin:0pt 0pt 0pt 0pt;list-style-type:decimal;color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:bold;font-style:normal;"><span style="color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:bold;font-style:normal;">That </span><span style="color:#000000;background-color:#C0C0C0;font-family:Calibri;font-size:11pt;font-weight:bold;font-style:normal;">(residents name)</span><span style="color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:bold;font-style:normal;"> be thanked for his/her/their presentation and any notes that comply with Council's Code of Practice for Meeting Procedures and the laws of defamation, be included in the Minutes.</span></li></ol>
Below is the actual output
This is the expected output