HtmlArea List Formatting Issues

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v12)  /  HtmlArea List Formatting Issues

DynamicPDF CoreSuite for .NET (v12) Forum

 Sep 18 2024 5:51 PM
I've searched pretty exhaustively but have not been able to resolve this issue. I am generating a PDF programmatically in C# and using HtmlArea page elements. The html I'm working with is very basic but for all of my unordered / ordered list, the bullets are twice as large as they should be and are not vertically centered with the text. I'm using a Google Font (but I've tried with system fonts also), and I'm wrapping my html snippet in a <div> element. I have also adjusted the line height of the <li> elements to 2 since I require more space between line items. I've tried targeting the bullet with CSS pseudo elements but it has no effect. How can I manipulate the size and alignment of the bullets/numbers?

Here's a sample of my C# methods that are manipulating the markup:

html (the text string passed in to my C# method):

<ul>
   <li>Item 1</li>
   <li>Item 2</li>
   <li>Item 3</li>
</ul>

C# code and methods:

HtmlArea htmlArea = new HtmlArea(WrapWithHtmlStyle(data), 20, currentY, pageDimensions.Body.Width - 40, 0);
htmlArea.FontSelecting += HtmlArea_FontSelecting;

private static string WrapWithHtmlStyle(string text)
{
    return $"<div style=\"font-color: #242424; font-size: 16px; font-weight: 300; line-height: 2;\">{text}</div>";
}

private void HtmlArea_FontSelecting(object sender, FontSelectingEventArgs e)
{
    e.Font = defaultFontThin;
}

Thanks for your help!
 Sep 28 2024 10:37 AM
[b][url=horecamiami.com] [/url][/b]
 Resort  Improvement
Revitalize your  resort with our expert renovation  solutions. We  deal with everything from design updates to structural  renovations,  guaranteeing your hotel  provides a modern and comfortable  visitor experience.

All times are US Eastern Standard time. The time now is 12:12 PM.