First of all – i think you guys have done a very nice job with your Lists API – you make something very complicated, simple.
Thank you this gets be close, but I am hung up on one thing. Follows is a more real to life example:
I have removed the
tags. In its place are
and that seems to work fine. The issue is getting the the ordered list in the html to lineup with the listLevel.TextPosition in the main list.
I want the “1.” of the inner list to align with the text “Testing inserting HTML”.
Thank you,
Jonathan
private void btnTest_Click(object sender, EventArgs e)
{
Document doc = new Document();
List list = doc.Lists.Add(ListTemplate.OutlineHeadingsLegal);
ListLevel level1 = list.ListLevels[0];
level1.NumberFormat = "\x0000.0";
level1.NumberPosition = 0;
level1.TabPosition = PointsInInch(0.4d);
level1.TextPosition = PointsInInch(0.4d);
ListLevel level2 = list.ListLevels[1];
level2.NumberStyle = NumberStyle.LeadingZero;
level2.NumberFormat = "\x0000.\x0001";
level2.NumberPosition = PointsInInch(0);
level2.TabPosition = PointsInInch(0.4d);
level2.TextPosition = PointsInInch(0.4d);
ListLevel level3 = list.ListLevels[2];
level3.NumberStyle = NumberStyle.LeadingZero;
level3.NumberFormat = "\x0000.\x0001.\x0002";
level3.NumberPosition = PointsInInch(0.4d);
level3.TabPosition = PointsInInch(1);
level3.TextPosition = PointsInInch(1);
DocumentBuilder builder = new DocumentBuilder(doc);
//builder.ParagraphFormat.SpaceAfterAuto = true;
builder.ListFormat.List = list;
builder.Writeln("The quick brown fox...");
builder.Writeln("The quick brown fox...");
builder.ListFormat.ListIndent();
builder.Writeln("jumped over the lazy dog.");
builder.ListFormat.ListIndent();
builder.InsertHtml("Testing instering HTML adsf adsf adsf adsf adsfklajsdf klajsdf kljasdfkl jakl;sdfj kl;adsjf klajsdf klajsdfkl jasdf klja;sdf aklsd;fj klasdjf afewiajdsvm ioasdfklmnewf oipasdf kamnsdklfaiweojaweiorj aosdf aisdjfoaweriaewjio adsjf aidsjfoaewjioaejw ioadsfj oo<br/><br/> asfasd asdf adsf adsf asdf asdf asdf adsf asdf adsf adsf adsf asdf adsf adsfaadsf adsf ads<br /> <ol><li>Outer HTML List 1.</li><li>Outer HTML List 2.</li><ol><li>Inner HTML List 1</li><li>Inner HTML List 2</li></ol></ol>");
builder.ListFormat.List = list;
builder.ListFormat.ListIndent();
builder.Writeln("jumped over the lazy dog.");
builder.ListFormat.ListOutdent();
builder.Writeln("The quick brown fox...");
builder.ListFormat.RemoveNumbers();
builder.Document.Save("Lists.CreateCustomList Out.doc");
}
public double PointsInInch(int inches) { return Convert.ToDouble(72 * inches); }
public double PointsInInch(double inches) { return 72 * inches; }