I am going through all the posts I can find to figure out using bullet lists.
I am creating a document that uses PDFSharp and MigraDoc together.
Here is how I am rendering paragraph by paragraph right now:
Code:
Dim docRenderer As DocumentRenderer = New DocumentRenderer(doc)
docRenderer.PrepareDocument()
docRenderer.RenderObject(gfx, XUnit.FromMillimeter(22.225), XUnit.FromMillimeter(22.225), "18cm", eligReq)
docRenderer.RenderObject(gfx, XUnit.FromMillimeter(22.225), XUnit.FromMillimeter(36.5), "18cm", partElg)
docRenderer.RenderObject(gfx, XUnit.FromMillimeter(22.225), XUnit.FromMillimeter(41.275), "18cm", para2)
docRenderer.RenderObject(gfx, XUnit.FromMillimeter(22.225), XUnit.FromMillimeter(65.0875), "18cm", para3)
I am rendering like this so I can control where the paragraphs appear on the page (I might be doing it wrong, I don't know for sure).
Now I am ready to add bulleted lists of items in my document and realize that I don't know how to render them using the technique I have been using up to now. Normally, I render paragraph by paragraph, but in a bullet list, I have several paragraphs making up my bullet list, like this:
Code:
Dim idx As Int32
For idx = 0 To listItems1.Count - 1
Dim listInfo As ListInfo = New ListInfo()
listInfo.ContinuePreviousList = (idx > 0)
listInfo.ListType = ListType.BulletList1
Dim addPar As Paragraph = sec.AddParagraph(listItems1.Item(idx))
addPar.Style = "bullet1"
addPar.Format.ListInfo = listInfo
Next
As you can see, I am manually moving each paragraph down the page of the document by setting the XUnit values for "Y".
e.g. docRenderer.RenderObject(gfx, XUnit.FromMillimeter(22.225), XUnit.FromMillimeter(41.275), "18cm", para2)
docRenderer.RenderObject(gfx, XUnit.FromMillimeter(22.225), XUnit.FromMillimeter(65.0875), "18cm", para3)
Obviously, this isn't going to work for the paragraphs in the bullet list. Any advice?
Thank you,
Randy